comparison core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigDirectoryTest.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents
children
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
1 <?php
2
3 namespace Drupal\FunctionalTests\Installer;
4
5 /**
6 * Tests the installer when a config_directory has already been set up.
7 *
8 * @group Installer
9 */
10 class InstallerExistingConfigDirectoryTest extends InstallerTestBase {
11
12 /**
13 * The expected file perms of the folder.
14 *
15 * @var int
16 */
17 protected $expectedFilePerms;
18
19 /**
20 * {@inheritdoc}
21 */
22 protected function prepareEnvironment() {
23 parent::prepareEnvironment();
24 mkdir($this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/config_read_only', 0444);
25 $this->expectedFilePerms = fileperms($this->siteDirectory . '/config_read_only');
26 $this->settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) [
27 'value' => $this->siteDirectory . '/config_read_only',
28 'required' => TRUE,
29 ];
30 }
31
32 /**
33 * Verifies that installation succeeded.
34 */
35 public function testInstaller() {
36 $this->assertUrl('user/1');
37 $this->assertResponse(200);
38 $this->assertEqual($this->expectedFilePerms, fileperms($this->siteDirectory . '/config_read_only'));
39 $this->assertEqual([], glob($this->siteDirectory . '/config_read_only/*'), 'The sync directory is empty after install because it is read-only.');
40 }
41
42 }