Chris@17
|
1 <?php
|
Chris@17
|
2
|
Chris@17
|
3 namespace Drupal\FunctionalTests\Installer;
|
Chris@17
|
4
|
Chris@17
|
5 /**
|
Chris@17
|
6 * Verifies that profiles with hook_install() can't be installed from config.
|
Chris@17
|
7 *
|
Chris@17
|
8 * @group Installer
|
Chris@17
|
9 */
|
Chris@17
|
10 class InstallerExistingConfigProfileHookInstall extends InstallerExistingConfigTestBase {
|
Chris@17
|
11
|
Chris@17
|
12 protected $profile = 'config_profile_with_hook_install';
|
Chris@17
|
13
|
Chris@17
|
14 /**
|
Chris@17
|
15 * {@inheritdoc}
|
Chris@17
|
16 */
|
Chris@17
|
17 protected function visitInstaller() {
|
Chris@17
|
18 // Create an .install file with a hook_install() implementation.
|
Chris@17
|
19 $path = $this->siteDirectory . '/profiles/' . $this->profile;
|
Chris@17
|
20 $contents = <<<EOF
|
Chris@17
|
21 <?php
|
Chris@17
|
22
|
Chris@17
|
23 function config_profile_with_hook_install_install() {
|
Chris@17
|
24 }
|
Chris@17
|
25 EOF;
|
Chris@17
|
26 file_put_contents("$path/{$this->profile}.install", $contents);
|
Chris@17
|
27 parent::visitInstaller();
|
Chris@17
|
28 }
|
Chris@17
|
29
|
Chris@17
|
30 /**
|
Chris@17
|
31 * Installer step: Configure settings.
|
Chris@17
|
32 */
|
Chris@17
|
33 protected function setUpSettings() {
|
Chris@17
|
34 // There are errors therefore there is nothing to do here.
|
Chris@17
|
35 return;
|
Chris@17
|
36 }
|
Chris@17
|
37
|
Chris@17
|
38 /**
|
Chris@17
|
39 * Final installer step: Configure site.
|
Chris@17
|
40 */
|
Chris@17
|
41 protected function setUpSite() {
|
Chris@17
|
42 // There are errors therefore there is nothing to do here.
|
Chris@17
|
43 return;
|
Chris@17
|
44 }
|
Chris@17
|
45
|
Chris@17
|
46 /**
|
Chris@17
|
47 * {@inheritdoc}
|
Chris@17
|
48 */
|
Chris@17
|
49 protected function getConfigTarball() {
|
Chris@17
|
50 // We're not going to get to the config import stage so this does not
|
Chris@17
|
51 // matter.
|
Chris@17
|
52 return __DIR__ . '/../../../fixtures/config_install/testing_config_install_no_config.tar.gz';
|
Chris@17
|
53 }
|
Chris@17
|
54
|
Chris@17
|
55 /**
|
Chris@17
|
56 * Confirms the installation has failed and the expected error is displayed.
|
Chris@17
|
57 */
|
Chris@17
|
58 public function testConfigSync() {
|
Chris@17
|
59 $this->assertTitle('Requirements problem | Drupal');
|
Chris@17
|
60 $this->assertText($this->profile);
|
Chris@17
|
61 $this->assertText('The selected profile has a hook_install() implementation and therefore can not be installed from configuration.');
|
Chris@17
|
62 }
|
Chris@17
|
63
|
Chris@17
|
64 }
|