As from 9th Nov testing at core 8.8 and 8.9 has produced the following new deprecation warning:

34x: 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.

Issue: #2352949: Deprecate using Classy as the default theme for the 'testing' profile
Change record: https://www.drupal.org/node/3083055

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Title: New deprecations: BrowserTestBase::$defaultTheme, non-boolean values in ::assertTrue and ::assertFalse » Deprecations: BrowserTestBase::$defaultTheme, non-boolean values in ::assertTrue and ::assertFalse

The 34x Drupal\Tests\BrowserTestBase::$defaultTheme is one for every test file.

jonathan1055’s picture

Title: Deprecations: BrowserTestBase::$defaultTheme, non-boolean values in ::assertTrue and ::assertFalse » Deprecation: add $defaultTheme to BrowserTestBase
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new773 bytes

Splitting into separate issues. This one is now just for $defaultTheme. Patch adds it to BrowserTestBase and sets suppress-deprecations: false in drupalci.yml. Two tests will fail with this and other deprecations will cause fails, but the following 34 should be gone

34x: 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.
jonathan1055’s picture

StatusFileSize
new2.23 KB

The $defaultTheme deprecation warnings have gone, as expected. Two tests have to be adjusted because 'stark' theme has fewer classes added to page elements.

1) Drupal\Tests\scheduler\Functional\SchedulerRulesActionsTest::testPublishOnActions
Behat\Mink\Exception\ElementNotFoundException: Element matching css ".messages--warning" not found.
/var/www/html/modules/contrib/scheduler/tests/src/Functional/SchedulerRulesActionsTest.php:177

2) Drupal\Tests\scheduler\Functional\SchedulerRulesActionsTest::testUnpublishOnActions
Behat\Mink\Exception\ElementNotFoundException: Element matching css ".messages--warning" not found.
/var/www/html/modules/contrib/scheduler/tests/src/Functional/SchedulerRulesActionsTest.php:333

This patch uses 'xpath', '//div[@aria-label="Warning message" instead of elementTextContains('css', '.messages--warning'

jonathan1055’s picture

StatusFileSize
new1.95 KB

Now back to supressing deprecations.

jonathan1055’s picture

StatusFileSize
new3.4 KB

  • jonathan1055 committed f2e8534 on 8.x-1.x
    Issue #3093399 by jonathan1055: Deprecation: add $defaultTheme to...
jonathan1055’s picture

Status: Needs review » Fixed

Fixed.

Status: Fixed » Closed (fixed)

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