Problem/Motivation

TestSiteInstallCommand does not yet provide the property but it's not tested with deprecation messages so we never got to see that warning.

Proposed resolution

Default to stark. I think my patch might be too simple though as it won't trigger the install profile logic anymore.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

Status: Active » Needs review
FileSize
1.82 KB

Status: Needs review » Needs work

The last submitted patch, 2: default-theme-3110874-2.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 2: default-theme-3110874-2.patch, failed testing. View results

andypost’s picture

Title: Rmove BC layer for TestSetupTrait » Remove BC layer for TestSetupTrait
Berdir’s picture

Most fails are in simpletest.module, so we could possibly wait on those being removed assuming that will happen?

andypost’s picture

Status: Needs work » Needs review
FileSize
9.38 KB
11.2 KB

3 are core tests, remains are simpletest

Status: Needs review » Needs work

The last submitted patch, 7: 3110874-7.patch, failed testing. View results

andypost’s picture

Status: Needs work » Needs review
FileSize
1.29 KB
12.48 KB

Can't get how to fix 2 remaining but there 2 more down

Status: Needs review » Needs work

The last submitted patch, 9: 3110874-9.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review
FileSize
4.68 KB

Reroll following the removal of Simpletest.

Status: Needs review » Needs work

The last submitted patch, 11: 3110874-11.patch, failed testing. View results

alexpott’s picture

+++ b/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php
@@ -37,6 +37,13 @@ class TestSiteInstallCommand extends Command {
+  /**
+   * The theme to install as the default.
+   *
+   * @var string
+   */
+  protected $defaultTheme = 'stark';

So I'm not sure this is the correct change.

I think we should remove the calls to

 $this->installDefaultThemeFromClassProperty($container);
    $this->installModulesFromClassProperty($container);

in \Drupal\TestSite\Commands\TestSiteInstallCommand::installDrupal() - they look meaningless as this is not a test and you don't inherit from it.

To maintain BC we should install classy and set it as the default theme in \Drupal\TestSite\Commands\TestSiteInstallCommand::installDrupal() and then we should file an issue to discuss the default theme in tests (like Nightwatch) that use this command.

alexpott’s picture

Title: Remove BC layer for TestSetupTrait » [PP-1] Remove BC layer for TestSetupTrait
Priority: Normal » Critical
lauriii’s picture

Title: [PP-1] Remove BC layer for TestSetupTrait » Remove BC layer for TestSetupTrait
longwave’s picture

Status: Needs work » Needs review
FileSize
4.09 KB

Reroll following #3115903: Remove test cruft from TestSiteInstallCommand, removing the change to TestSiteInstallCommand.

Status: Needs review » Needs work

The last submitted patch, 16: 3110874-16.patch, failed testing. View results

andypost’s picture

Status: Needs work » Needs review
FileSize
3.76 KB
4.91 KB

Fix the test (LegacyStyleSheetsRemoveTest) and I think we could use @inheritdoc because variable defined in parent class
New exception also documented

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @andypost, changes look good to me and I agree we can use inheritdoc.

andypost’s picture

+++ b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
@@ -400,6 +400,9 @@ protected function initKernel(Request $request) {
+   * @throws \Exception

@@ -420,11 +423,7 @@ protected function installDefaultThemeFromClassProperty(ContainerInterface $cont
+      throw new \Exception('Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.');

I wonder if we should use InvalidArgumentException or DomainException https://www.php.net/manual/en/class.domainexception.php

  • alexpott committed 305c401 on 9.0.x
    Issue #3110874 by andypost, longwave, Berdir: Remove BC layer for...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

@andypost I just pushed and x-posted with you. Feel free to open a follow-up. I don;t think this matters because you're not going to be catching this exception in calling code and doing something else - you going to be fixing your test and moving on.

Committed 305c401 and pushed to 9.0.x. Thanks!

andypost’s picture

NP, thank you! That's surely runtime exception so no reason to followup

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.