InstallerExistingConfigProfileHookInstall.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstall.php
View source
<?php
namespace Drupal\FunctionalTests\Installer;
class InstallerExistingConfigProfileHookInstall extends InstallerExistingConfigTestBase {
protected $profile = 'config_profile_with_hook_install';
protected function visitInstaller() {
$path = $this->siteDirectory . '/profiles/' . $this->profile;
$contents = <<<EOF
<?php
function config_profile_with_hook_install_install() {
}
EOF;
file_put_contents("{$path}/{$this->profile}.install", $contents);
parent::visitInstaller();
}
protected function setUpSettings() {
}
protected function setUpSite() {
}
protected function getConfigTarball() {
return __DIR__ . '/../../../fixtures/config_install/testing_config_install_no_config.tar.gz';
}
public function testConfigSync() {
$this
->assertSession()
->titleEquals('Requirements problem | Drupal');
$this
->assertSession()
->pageTextContains($this->profile);
$this
->assertSession()
->pageTextContains('The selected profile has a hook_install() implementation and therefore can not be installed from configuration.');
}
}