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 InstallerExistingConfigSyncDirectoryProfileHookInstall extends InstallerExistingConfigTestBase {
|
Chris@17
|
11
|
Chris@17
|
12 /**
|
Chris@17
|
13 * {@inheritdoc}
|
Chris@17
|
14 */
|
Chris@17
|
15 protected $profile = 'testing_config_install_multilingual';
|
Chris@17
|
16
|
Chris@17
|
17 /**
|
Chris@17
|
18 * {@inheritdoc}
|
Chris@17
|
19 */
|
Chris@17
|
20 protected $existingSyncDirectory = TRUE;
|
Chris@17
|
21
|
Chris@17
|
22 /**
|
Chris@17
|
23 * {@inheritdoc}
|
Chris@17
|
24 */
|
Chris@17
|
25 protected function visitInstaller() {
|
Chris@17
|
26 // Create an .install file with a hook_install() implementation.
|
Chris@17
|
27 $path = $this->siteDirectory . '/profiles/' . $this->profile;
|
Chris@17
|
28 $contents = <<<EOF
|
Chris@17
|
29 <?php
|
Chris@17
|
30
|
Chris@17
|
31 function testing_config_install_multilingual_install() {
|
Chris@17
|
32 }
|
Chris@17
|
33 EOF;
|
Chris@17
|
34 file_put_contents("$path/{$this->profile}.install", $contents);
|
Chris@17
|
35 parent::visitInstaller();
|
Chris@17
|
36 }
|
Chris@17
|
37
|
Chris@17
|
38 /**
|
Chris@17
|
39 * Installer step: Select installation profile.
|
Chris@17
|
40 */
|
Chris@17
|
41 protected function setUpProfile() {
|
Chris@17
|
42 // This is the form we are testing so wait until the test method to do
|
Chris@17
|
43 // assertions.
|
Chris@17
|
44 return;
|
Chris@17
|
45 }
|
Chris@17
|
46
|
Chris@17
|
47 /**
|
Chris@17
|
48 * Installer step: Requirements problem.
|
Chris@17
|
49 */
|
Chris@17
|
50 protected function setUpRequirementsProblem() {
|
Chris@17
|
51 // This form will never be reached.
|
Chris@17
|
52 return;
|
Chris@17
|
53 }
|
Chris@17
|
54
|
Chris@17
|
55 /**
|
Chris@17
|
56 * Installer step: Configure settings.
|
Chris@17
|
57 */
|
Chris@17
|
58 protected function setUpSettings() {
|
Chris@17
|
59 // This form will never be reached.
|
Chris@17
|
60 return;
|
Chris@17
|
61 }
|
Chris@17
|
62
|
Chris@17
|
63 /**
|
Chris@17
|
64 * Final installer step: Configure site.
|
Chris@17
|
65 */
|
Chris@17
|
66 protected function setUpSite() {
|
Chris@17
|
67 // This form will never be reached.
|
Chris@17
|
68 return;
|
Chris@17
|
69 }
|
Chris@17
|
70
|
Chris@17
|
71 /**
|
Chris@17
|
72 * {@inheritdoc}
|
Chris@17
|
73 */
|
Chris@17
|
74 protected function getConfigTarball() {
|
Chris@17
|
75 return __DIR__ . '/../../../fixtures/config_install/multilingual.tar.gz';
|
Chris@17
|
76 }
|
Chris@17
|
77
|
Chris@17
|
78 /**
|
Chris@17
|
79 * Tests installing from config is not available due to hook_INSTALL().
|
Chris@17
|
80 */
|
Chris@17
|
81 public function testConfigSync() {
|
Chris@17
|
82 $this->assertSession()->titleEquals('Select an installation profile | Drupal');
|
Chris@17
|
83 $this->assertSession()->responseNotContains('Use existing configuration');
|
Chris@17
|
84
|
Chris@17
|
85 // Remove the install hook and the option to install from existing
|
Chris@17
|
86 // configuration will be available.
|
Chris@17
|
87 unlink("{$this->siteDirectory}/profiles/{$this->profile}/{$this->profile}.install");
|
Chris@17
|
88 $this->getSession()->reload();
|
Chris@17
|
89 $this->assertSession()->titleEquals('Select an installation profile | Drupal');
|
Chris@17
|
90 $this->assertSession()->responseContains('Use existing configuration');
|
Chris@17
|
91 }
|
Chris@17
|
92
|
Chris@17
|
93 }
|