mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-27 05:03:31 +00:00
[PHP70] Skip PHPUnit assert in ThisCallOnStaticMethodToStaticCallRector
This commit is contained in:
parent
7b4b4699b4
commit
02a79a06b4
|
@ -7,6 +7,7 @@ namespace Rector\Php70\Rector\MethodCall;
|
|||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Rector\NodeContainer\ParsedNodesByType;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\Rector\AbstractRector;
|
||||
|
@ -85,6 +86,12 @@ PHP
|
|||
return null;
|
||||
}
|
||||
|
||||
if ($this->isObjectType($node->var, TestCase::class)) {
|
||||
if ($this->isName($node->name, 'assert*')) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$className = $node->getAttribute(AttributeKey::CLASS_NAME);
|
||||
if (! is_string($className)) {
|
||||
return null;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Php70\Tests\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector\Fixture;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SkipPhpUnit extends TestCase
|
||||
{
|
||||
public function testMe()
|
||||
{
|
||||
$this->assertTrue(True);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user