Problem/Motivation
Today, the default theme when writing tests is classy
, which is likely deprecated in the future #3050378: Replace Classy with a starterkit theme. For this, and various other reasons Classy is decoupled from the testing infrastructure: #2352949: Deprecate using Classy as the default theme for the 'testing' profile. Until now, we assume there isn't a default value in Drupal 9 and it is required for all test cases not specifying installation profile to specify which theme they use in their tests. However, “no default” is just one of the possible choices.
The 3 possible choices:
Theme | Pros | Cons | When best fit? |
---|---|---|---|
None |
| Boilerplate: every test must specify it | N/A |
stark | No boilerplate | Higher probability of breaking between minor releases |
|
stable9 | No boilerplate | Higher probability of breaking between major releases |
|
(In Drupal 9, the default would be stable9
, in Drupal 10, it would be stable10
, and so on.)
Default: opt-in vs opt-out?
There might be a way to be both explicit and provide a default value. We could set a default value that is set only if the test case has explicitly opted into the default. One option would be provide TESTING_DEFAULT_THEME
constant which would allow test cases to use the current default value. This would remove the need to manually update testing theme on major releases.
- Drupal 9
const TESTING_DEFAULT_THEME = ‘stable9’; const CORE_TESTING_DEFAULT_THEME = ‘stark’;
- Drupal 10
const TESTING_DEFAULT_THEME = ‘stable10’; const CORE_TESTING_DEFAULT_THEME = ‘stark’;
Proposed resolution
TBD
Remaining tasks
- Decide what is the default theme for testing in Drupal 9 if any
- Decide if the default theme is set explicitly or implicitly
User interface changes
None
API changes
TBD