Add defaultTheme in tests extending BrowserTestBase.

Problem/Motivation

We should add defaultTheme where it will be required in tests extending BrowserTestBase.

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.

See https://www.drupal.org/node/3083055
and https://www.drupal.org/project/drupal/issues/3082655

Proposed resolution

Add the defaultTheme property to tests that extend BrowserTestBase, where appropriate or another theme where appropriate, based on https://www.drupal.org/node/3083055

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oknate created an issue. See original summary.

rpayanm’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
6 KB
oknate’s picture

Status: Needs review » Needs work

Excellent. Only thing I noticed:

It's missing for EntityBrowserUpdateHookTest, which extends UpdatePathTestBase which extends BrowserTestBase.

oknate’s picture

Status: Needs work » Needs review
FileSize
6.53 KB

Addressing #4.

oknate’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
oknate’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev

I can't get the 8.x-1.x branch to test against the upcoming releases 8.8 and 8.9.

I think #4 is ready for the 8.x-2.x branch, and I'm considering committing it there, but I don't think there's a rush, and I'd like to figure out why we have failures on the 8.9 branch.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Agreed, this is ready for 8.x-2.x.

https://www.drupal.org/pift-ci-job/1491221 is interesting, as it shows that we use FileSystem::copy(), that only exists in 8.7 and we didn't update our min version to that. AFAIK the media_entity team does not plan to make media_entity 9.0.x compatible (but someone else might), so I wouldn't bother with making the 8.x-1.x D9 ready unless someone steps up and helps :)

I've already commented in #3057212: Drupal 9 compatibility on how to update our core version dependency to make it explicit.

Not sure about 8.9, since both tests seem to be a about contrib module integrations, maybe the fault is in them? There aren't many changes in 8.8 vs 8.9 yet..

oknate’s picture

Queuing tests against 8.8. For some reason, I didn't do that in #4 yet.

oknate’s picture

Status: Reviewed & tested by the community » Needs work
oknate’s picture

Assigned: Unassigned » oknate
Status: Needs work » Needs review
FileSize
6 KB

Reroll.

phenaproxima’s picture

FileSize
7.03 KB

A shot in the dark, but I wonder if changing the default theme to Classy for ParagraphsTest and InlineEntityFormTest would fix this.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Yeah, that's certainly the easiest way to get them to pass for now, can always decouple from classy later.

  • oknate committed 203ebcf on 8.x-2.x authored by phenaproxima
    Issue #3095630 by oknate, rpayanm, phenaproxima: Add defaultTheme in...
oknate’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev

Committed to 8.x-2.x, let's see if it works for 8.x-1.x too.

  • oknate committed 85b73e3 on 8.x-1.x authored by phenaproxima
    Issue #3095630 by oknate, rpayanm, phenaproxima: Add defaultTheme in...
oknate’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x-2.x too.

Status: Fixed » Closed (fixed)

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