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

Comments

oknate created an issue. See original summary.

rpayanm’s picture

Status: Active » Needs review
StatusFileSize
new1.87 KB
berdir’s picture

Status: Needs review » Needs work
Issue tags: +Drupal 9 compatibility

Looks like that test requires classy?

Possibly also use this issue to add core_version_requirement ^8 || ^9 and the same to composer.json as a drupal/core dependency per https://www.drupal.org/node/3070687?

And running tests shows a bunch of deprecations, some like jquery ui might be tricky and several others require 8.8, so the requirement should be ^8.8:

  20x: EntityManagerInterface::getDefinitions() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getDefinitions() instead. See https://www.drupal.org/node/2549139
    2x in EntityDisplayTest::testFieldAccess from Drupal\Tests\field_group\Functional
    2x in EntityDisplayTest::testHtmlElement from Drupal\Tests\field_group\Functional
    2x in EntityDisplayTest::testFieldset from Drupal\Tests\field_group\Functional
    2x in EntityDisplayTest::testTabs from Drupal\Tests\field_group\Functional
    2x in EntityDisplayTest::testAccordion from Drupal\Tests\field_group\Functional
    2x in FieldGroupWithoutFieldUiTest::testLocalActions from Drupal\Tests\field_group\Functional
    2x in ManageDisplayTest::testCreateGroup from Drupal\Tests\field_group\Functional
    2x in ManageDisplayTest::testDeleteGroup from Drupal\Tests\field_group\Functional
    2x in ManageDisplayTest::testNestField from Drupal\Tests\field_group\Functional
    2x in FieldGroupUiTest::testCreateAndEdit from Drupal\Tests\field_group\FunctionalJavascript

  19x: Support for asserting against non-boolean values in ::assertTrue is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use a different assert method, for example, ::assertNotEmpty(). See https://www.drupal.org/node/3082086
    7x in EntityDisplayTest::testAccordion from Drupal\Tests\field_group\Functional
    6x in EntityDisplayTest::testTabs from Drupal\Tests\field_group\Functional
    4x in EntityDisplayTest::testHtmlElement from Drupal\Tests\field_group\Functional
    2x in EntityDisplayTest::testFieldset from Drupal\Tests\field_group\Functional

  4x: entity_get_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service('entity_display.repository')->getViewDisplay() instead. See https://www.drupal.org/node/2835616
    4x in MigrateFieldGroupTest::testFieldGroup from Drupal\Tests\field_group_migrate\Kernel\Migrate\d7

  2x: entity_get_form_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service('entity_display.repository')->getFormDisplay() instead. See https://www.drupal.org/node/2835616
    2x in MigrateFieldGroupTest::testFieldGroup from Drupal\Tests\field_group_migrate\Kernel\Migrate\d7

  1x: Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was Drupal\field_group\Element\VerticalTabs::preRenderGroup. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725
    1x in EntityDisplayTest::testTabs from Drupal\Tests\field_group\Functional

  1x: The "core/jquery.ui.accordion" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. See https://www.drupal.org/node/3067969
    1x in EntityDisplayTest::testAccordion from Drupal\Tests\field_group\Functional

sahana _n’s picture

Status: Needs work » Needs review
StatusFileSize
new2.63 KB

Please review the patch.

berdir’s picture

Status: Needs review » Needs work

Still need to change the failing test to use classy instead of stark.

ravi.shankar’s picture

Status: Needs work » Needs review
StatusFileSize
new2.53 KB
new1.84 KB

Here I have made changes as suggested in #5

berdir’s picture

Status: Needs review » Needs work

Only the one test that failed with stark (EntityDisplayTest) should be updated to classy, not all of them. That will likely require fewer changes in the future.

sahana _n’s picture

Status: Needs work » Needs review
StatusFileSize
new2.63 KB

Please review the patch.

berdir’s picture

Status: Needs review » Needs work
+++ b/field_group.info.yml
@@ -2,6 +2,6 @@ name: 'Field Group'
 package : Fields
-core: 8.x
+core_version_requirement: ^8 || ^9
 dependencies:
   - drupal:field

Missed this before, but if we go for ^8 then we should keep core: 8.x so that earlier core versions can also still install it.

rpayanm’s picture

Status: Needs work » Needs review
StatusFileSize
new2.51 KB
berdir’s picture

Status: Needs review » Reviewed & tested by the community

Now it looks good.

  • nils.destoop committed d9c96e4 on 8.x-3.x authored by rpayanm
    Issue #3095640 by rpayanm, Sahana _N, ravi.shankar: Add defaultTheme in...
nils.destoop’s picture

Status: Reviewed & tested by the community » Fixed

Thx for the patches and the reviews. I committed it to dev.

sahana _n’s picture

Status: Fixed » Closed (fixed)

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