Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Checking if extended class isn't TestCase #86

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/NodeVisitors/ClassVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ public function enterNode (PhpParser\Node $node)
$this->stack->addIssue (new FinalClassIssue($node));
}

if (!empty($node->extends))
{
if (
!empty($node->extends)
&& !in_array($node->extends->toString(), ['TestCase', 'PHPUnit\\Framework\\TestCase', 'PHPUnit_Framework_TestCase'])
) {
$this->stack->addIssue (new ExtendedClassIssue($node));
}
}
Expand Down