InstallerExistingConfigDirectoryTest.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigDirectoryTest.php
View source
<?php
namespace Drupal\FunctionalTests\Installer;
class InstallerExistingConfigDirectoryTest extends InstallerTestBase {
protected $defaultTheme = 'stark';
protected $expectedFilePerms;
protected function prepareEnvironment() {
parent::prepareEnvironment();
mkdir($this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/config_read_only', 0444);
$this->expectedFilePerms = fileperms($this->siteDirectory . '/config_read_only');
$this->settings['settings']['config_sync_directory'] = (object) [
'value' => $this->siteDirectory . '/config_read_only',
'required' => TRUE,
];
}
public function testInstaller() {
$this
->assertSession()
->addressEquals('user/1');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertEquals($this->expectedFilePerms, fileperms($this->siteDirectory . '/config_read_only'));
$this
->assertEquals([], glob($this->siteDirectory . '/config_read_only/*'), 'The sync directory is empty after install because it is read-only.');
}
}