3 namespace Drupal\system\Tests\Installer;
5 use Drupal\Component\Utility\Crypt;
6 use Drupal\simpletest\InstallerTestBase;
9 * Tests the installer when a config_directory set up but does not exist.
13 class InstallerConfigDirectorySetNoDirectoryTest extends InstallerTestBase {
16 * The sync directory created during the install.
20 protected $syncDirectory;
25 protected function setUp() {
26 $this->syncDirectory = $this->publicFilesDirectory . '/config_' . Crypt::randomBytesBase64() . '/sync';
27 $this->settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) [
28 'value' => $this->syncDirectory,
31 // Other directories will be created too.
32 $this->settings['config_directories']['custom'] = (object) [
33 'value' => $this->publicFilesDirectory . '/config_custom',
40 * Verifies that installation succeeded.
42 public function testInstaller() {
43 $this->assertUrl('user/1');
44 $this->assertResponse(200);
45 $this->assertTrue(file_exists($this->syncDirectory) && is_dir($this->syncDirectory), "The directory {$this->syncDirectory} exists.");
46 $this->assertTrue(file_exists($this->publicFilesDirectory . '/config_custom') && is_dir($this->publicFilesDirectory . '/config_custom'), "The directory {$this->publicFilesDirectory}/custom_config exists.");