Skip to content

Commit 295bde1

Browse files
committed
Ignore defaultTheme on abstract test classes
1 parent cf50248 commit 295bde1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Rules/Drupal/Tests/BrowserTestBaseDefaultThemeRule.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public function processNode(Node $node, Scope $scope): array
3535

3636
$reflection = $classType->getClassReflection();
3737
assert($reflection !== null);
38+
if ($reflection->isAbstract()) {
39+
return [];
40+
}
3841
$defaultProperties = $reflection->getNativeReflection()->getDefaultProperties();
3942
$defaultTheme = $defaultProperties['defaultTheme'] ?? null;
4043

tests/src/Rules/BrowserTestBaseDefaultThemeRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public function fileData(): \Generator
4545
__DIR__ . '/../../fixtures/drupal/modules/module_with_tests/tests/src/Functional/ExtendsDefaultThemeTest.php',
4646
[]
4747
];
48+
yield [
49+
__DIR__ . '/../../fixtures/drupal/core/modules/views/tests/src/Functional/ViewTestBase.php',
50+
[]
51+
];
4852
}
4953

5054
}

0 commit comments

Comments
 (0)