Skip to content

Commit 6001de5

Browse files
authored
Merge pull request #216 from codebymikey/patch-1
Avoid false positives when PHPUnit doesn't exist.
2 parents 47a3f6c + 28ec911 commit 6001de5

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
@@ -18,6 +18,10 @@ public function getNodeType(): string
1818

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

0 commit comments

Comments
 (0)