Skip to content

Commit 28ec911

Browse files
authored
Avoid false positives when PHPUnit doesn't exist.
1 parent 1d65da8 commit 28ec911

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Rules/Drupal/Tests/BrowserTestBaseDefaultThemeRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public function getNodeType(): string
1717

1818
public function processNode(Node $node, Scope $scope): array
1919
{
20+
if (!interface_exists(\PHPUnit\Framework\Test::class)) {
21+
// PHPUnit is unavailable in the class loader.
22+
return [];
23+
}
2024
assert($node instanceof Node\Stmt\Class_);
2125
if ($node->extends === null) {
2226
return [];

0 commit comments

Comments
 (0)