You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, let me say that I think this is an edge case, so I really don't know if there's value in trying to solve this... would be totally OK if this gets closed as "wontfix".
In my particular issue, when Drupal announced that $defaultTheme must be set for all tests, in my project we started setting this via a trait, but the trait sets the property at runtime. Given this is a very unique use case, I would be happy to just ignore this rule, so I opened #772 which would help me ignore it.
I'm not totally sure if this is a useful bug report for other reasons.. just to consider that the property may be set outside the test itself...?
Code snippet that reproduces the problem
Here is how I set $defaultTheme via trait...
trait ThemeTestTrait {
/**
* {@inheritdoc}
*
* Set all custom tests to use stark by default.
*
* This was introduced in Drupal core v9 where all tests switched from the
* classy theme to an undefined theme.
*
* @see https://www.drupal.org/node/3083055
*/
protected function installDefaultThemeFromClassProperty(ContainerInterface $container): void {
if (!isset($this->defaultTheme)) {
$this->defaultTheme = 'stark';
}
parent::installDefaultThemeFromClassProperty($container);
The text was updated successfully, but these errors were encountered:
Hmm... so I've revisited this problem recently, and granted setting this property via a method I view as an edge case, I think that simply setting the property via a trait would be less of an edge case, and that does not appear to work, either...
Bug report
First, let me say that I think this is an edge case, so I really don't know if there's value in trying to solve this... would be totally OK if this gets closed as "wontfix".
In my particular issue, when Drupal announced that
$defaultTheme
must be set for all tests, in my project we started setting this via a trait, but the trait sets the property at runtime. Given this is a very unique use case, I would be happy to just ignore this rule, so I opened #772 which would help me ignore it.I'm not totally sure if this is a useful bug report for other reasons.. just to consider that the property may be set outside the test itself...?
Code snippet that reproduces the problem
Here is how I set
$defaultTheme
via trait...The text was updated successfully, but these errors were encountered: