InstallerExistingConfigSyncDirectoryProfileHookInstall.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileHookInstall.php
View source
<?php
namespace Drupal\FunctionalTests\Installer;
class InstallerExistingConfigSyncDirectoryProfileHookInstall extends InstallerExistingConfigTestBase {
protected $defaultTheme = 'stark';
protected $profile = 'testing_config_install_multilingual';
protected $existingSyncDirectory = TRUE;
protected function visitInstaller() {
$path = $this->siteDirectory . '/profiles/' . $this->profile;
$contents = <<<EOF
<?php
function testing_config_install_multilingual_install() {
}
EOF;
file_put_contents("{$path}/{$this->profile}.install", $contents);
parent::visitInstaller();
}
protected function setUpProfile() {
}
protected function setUpRequirementsProblem() {
}
protected function setUpSettings() {
}
protected function setUpSite() {
}
protected function getConfigTarball() {
return __DIR__ . '/../../../fixtures/config_install/multilingual.tar.gz';
}
public function testConfigSync() {
$this
->assertSession()
->titleEquals('Select an installation profile | Drupal');
$this
->assertSession()
->responseNotContains('Use existing configuration');
unlink("{$this->siteDirectory}/profiles/{$this->profile}/{$this->profile}.install");
$this
->getSession()
->reload();
$this
->assertSession()
->titleEquals('Select an installation profile | Drupal');
$this
->assertSession()
->responseContains('Use existing configuration');
}
}