class InstallerExistingConfigSyncDirectoryProfileHookInstall
Same name and namespace in other branches
- 10 core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileHookInstall.php \Drupal\FunctionalTests\Installer\InstallerExistingConfigSyncDirectoryProfileHookInstall
- 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileHookInstall.php \Drupal\FunctionalTests\Installer\InstallerExistingConfigSyncDirectoryProfileHookInstall
Verifies that profiles with hook_install() can't be installed from config.
@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\InstallerExistingConfigTestBase implements \Drupal\FunctionalTests\Installer\InstallerTestBase
- class \Drupal\FunctionalTests\Installer\InstallerExistingConfigSyncDirectoryProfileHookInstall implements \Drupal\FunctionalTests\Installer\InstallerExistingConfigTestBase
- class \Drupal\FunctionalTests\Installer\InstallerExistingConfigTestBase implements \Drupal\FunctionalTests\Installer\InstallerTestBase
- class \Drupal\FunctionalTests\Installer\InstallerTestBase uses \Drupal\Tests\RequirementsPageTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of InstallerExistingConfigSyncDirectoryProfileHookInstall
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerExistingConfigSyncDirectoryProfileHookInstall.php, line 10
Namespace
Drupal\FunctionalTests\InstallerView source
class InstallerExistingConfigSyncDirectoryProfileHookInstall extends InstallerExistingConfigTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected $profile = 'testing_config_install_multilingual';
/**
* {@inheritdoc}
*/
protected $existingSyncDirectory = TRUE;
/**
* {@inheritdoc}
*/
protected function visitInstaller() {
// Create an .install file with a hook_install() implementation.
$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();
}
/**
* Installer step: Select installation profile.
*/
protected function setUpProfile() {
// This is the form we are testing so wait until the test method to do
// assertions.
}
/**
* Installer step: Requirements problem.
*/
protected function setUpRequirementsProblem() {
// This form will never be reached.
}
/**
* Installer step: Configure settings.
*/
protected function setUpSettings() {
// This form will never be reached.
}
/**
* Final installer step: Configure site.
*/
protected function setUpSite() {
// This form will never be reached.
}
/**
* {@inheritdoc}
*/
protected function getConfigTarball() {
return __DIR__ . '/../../../fixtures/config_install/multilingual.tar.gz';
}
/**
* Tests installing from config is not available due to hook_INSTALL().
*/
public function testConfigSync() {
$this->assertSession()
->titleEquals('Select an installation profile | Drupal');
$this->assertSession()
->responseNotContains('Use existing configuration');
// Remove the install hook and the option to install from existing
// configuration will be available.
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');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.