Problem/Motivation
Because of #3083275: [meta] Update tests that rely on Classy to not rely on it anymore and Classy being deprecated in Drupal 9 + removed in Drupal 10,: Tests that aren't specifically testing Classy yet declare $defaultTheme = 'classy'; should be refactored to use Stark as the default theme instead.
Proposed resolution
Change all tests in this module to use Stark as the default theme, and refactor the tests where needed so they continue to function properly.
This one appears to be fairly simple.
1. Do a find-replace that changes classy to stark in the locale module.
2. In Drupal\Tests\locale\Functional\LocaleContentTest::testContentTypeDirLang() remove the node class from the cssSelect calls. For example:
Before: $this->cssSelect('article.node[lang="en"]');
After: $this->cssSelect('article[lang="en"]');
That node class comes from the node.html.twig template in classy.
Issue fork drupal-3274265
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
danflanagan8I marked this as Novice in an attempt to get some new contributors on the case. I promise quick reviews. :)
Comment #3
Johnny Santos commentedGoing for it, thanks for the tag!
Comment #5
Johnny Santos commentedDone as told on the issue, thanks again.
Comment #6
danflanagan8Thanks, @Johnny Santos!
This module actually has some Kernel tests that rely on Classy in addition to the Functional tests that you have addressed.
Could you please replace
classywithstarkin1.
Drupal\Tests\locale\Kernel\LocaleConfigManagerTest2.
core/modules/locale/tests/modules/locale_test/config/optional/block.block.test_default_config.ymlThanks!
Comment #7
Johnny Santos commentedSure, on it
Comment #8
Johnny Santos commentedOk, just did as asked on comment #6
Comment #9
danflanagan8Oops, I missed something important when I was triaging this issue. There was a failure:
The line that triggered that is:
$this->assertSession()->responseContains('messages--status');Now that we're using stark, that class isn't on messages. That assertion escaped my normal search for
css,xpath, andclass=.Luckily there is an easy fix! You can use one of the new assertions described here: https://www.drupal.org/node/3270424
In this case, the test is just asserting that a status message is present. So you can change the line of code to:
$this->assertSession()->statusMessageExists('status')Comment #10
Johnny Santos commentedNo problem, going for it as well
Comment #11
Johnny Santos commentedJust fixed and changed the method as asked.
Thanks for the documentation!
Comment #12
danflanagan8Thanks, @Johnny Santos!
MR looks good. All green.
In case it comes in handy in the future, here are the docs on running phpunit tests locally: https://www.drupal.org/docs/automated-testing/phpunit-in-drupal/running-...
Thanks for getting involved!
Comment #13
alexpottCommitted and pushed 5c6d023687 to 10.0.x and f56cd047c2 to 9.4.x. Thanks!