class InstallerExistingConfigDirectoryTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigDirectoryTest.php \Drupal\FunctionalTests\Installer\InstallerExistingConfigDirectoryTest
Tests installation when a config_sync_directory exists and is set up.
@group Installer
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Installer\InstallerTestBase uses \Drupal\Tests\RequirementsPageTrait implements \Drupal\Tests\BrowserTestBase
- class \Drupal\FunctionalTests\Installer\InstallerExistingConfigDirectoryTest implements \Drupal\FunctionalTests\Installer\InstallerTestBase
- class \Drupal\FunctionalTests\Installer\InstallerTestBase uses \Drupal\Tests\RequirementsPageTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of InstallerExistingConfigDirectoryTest
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerExistingConfigDirectoryTest.php, line 10
Namespace
Drupal\FunctionalTests\InstallerView source
class InstallerExistingConfigDirectoryTest extends InstallerTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* The expected file perms of the folder.
*
* @var int
*/
protected $expectedFilePerms;
/**
* {@inheritdoc}
*/
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,
];
}
/**
* Verifies that installation succeeded.
*/
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.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.