core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php | 5 +++-- core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php | 2 ++ .../Drupal/FunctionalTests/Installer/InstallerTranslationTest.php | 7 +------ core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php | 5 ----- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php index 8b050f749b..3154b7f0d0 100644 --- a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php +++ b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php @@ -421,7 +421,8 @@ protected function initKernel(Request $request) { protected function installDefaultThemeFromClassProperty(ContainerInterface $container) { // Use the install profile to determine the default theme if configured and // not already specified. - $default_install_path = drupal_get_path('profile', $this->profile) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; + $profile = $container->getParameter('install_profile'); + $default_install_path = drupal_get_path('profile', $profile) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; $profile_config_storage = new FileStorage($default_install_path, StorageInterface::DEFAULT_COLLECTION); if (!isset($this->defaultTheme) && $profile_config_storage->exists('system.theme')) { $this->defaultTheme = $profile_config_storage->read('system.theme')['default']; @@ -433,7 +434,7 @@ protected function installDefaultThemeFromClassProperty(ContainerInterface $cont // on Drupal 8 automatically get 'classy' set, and other profiles use // 'stark'. @trigger_error('Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/2352949, which includes recommendations on which theme to use.', E_USER_DEPRECATED); - $this->defaultTheme = $this->profile === 'testing' ? 'classy' : 'stark'; + $this->defaultTheme = $profile === 'testing' ? 'classy' : 'stark'; } // Ensure the default theme is installed. diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php index eaccc1bdf2..a41eea79d8 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php @@ -191,6 +191,8 @@ protected function setUp() { ->getEditable('system.mail') ->set('interface.default', 'test_mail_collector') ->save(); + + $this->installDefaultThemeFromClassProperty($this->container); } } diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php index 689117096d..55ce6b534c 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php @@ -19,11 +19,6 @@ class InstallerTranslationTest extends InstallerTestBase { */ protected $langcode = 'de'; - /** - * {@inheritdoc} - */ - protected $profile = 'standard'; - /** * {@inheritdoc} */ @@ -69,7 +64,7 @@ protected function setUpSettings() { * Verifies the expected behaviors of the installation result. */ public function testInstaller() { - $this->assertUrl('node'); + $this->assertUrl('user/1'); $this->assertResponse(200); // Verify German was configured but not English. diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php index 80f3ea7846..d7bad28513 100644 --- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php @@ -74,11 +74,6 @@ abstract class UpdatePathTestBase extends BrowserTestBase { */ protected $installProfile = 'standard'; - /** - * {@inheritdoc} - */ - protected $profile = 'standard'; - /** * Flag that indicates whether the child site has been updated. *