[PHP70] Skip PHPUnit assert in ThisCallOnStaticMethodToStaticCallRector

This commit is contained in:
TomasVotruba 2019-11-08 16:48:05 +01:00
parent 7b4b4699b4
commit 02a79a06b4
2 changed files with 20 additions and 0 deletions

View File

@ -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;

View File

@ -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);
}
}