make CloningNodeVistior fail

This commit is contained in:
TomasVotruba 2017-10-28 16:59:20 +02:00
parent 30fed31ca5
commit 9c74e03d8c
2 changed files with 8 additions and 16 deletions

View File

@ -14,7 +14,7 @@
"nikic/php-parser": "v4.0.0alpha1 as 3.1.1",
"phpdocumentor/reflection-docblock": "^4.1",
"phpdocumentor/type-resolver": "^0.4.0",
"rector/better-reflection": "^3.0.2",
"rector/better-reflection": "dev-master",
"symfony/console": "^3.3",
"symfony/dependency-injection": "^3.3",
"symplify/package-builder": "^2.5"

View File

@ -9,7 +9,6 @@ use Rector\Contract\Parser\ParserInterface;
use Rector\Printer\FormatPerservingPrinter;
use Rector\Tests\AbstractContainerAwareTestCase;
use SplFileInfo;
use Throwable;
final class NodeTraverserQueueTest extends AbstractContainerAwareTestCase
{
@ -43,22 +42,15 @@ final class NodeTraverserQueueTest extends AbstractContainerAwareTestCase
public function testRaw(): void
{
try {
$oldStmts = $this->parser->parseFile($this->fileInfo->getRealPath());
$oldTokens = $this->lexer->getTokens();
$oldStmts = $this->parser->parseFile($this->fileInfo->getRealPath());
$oldTokens = $this->lexer->getTokens();
$cloningNodeTraverser = new NodeTraverser;
$cloningNodeTraverser->addVisitor(new CloningVisitor);
$cloningNodeTraverser = new NodeTraverser;
$cloningNodeTraverser->addVisitor(new CloningVisitor);
$newStmts = $cloningNodeTraverser->traverse($oldStmts);
$newStmts = $cloningNodeTraverser->traverse($oldStmts);
$processedFileContent = $this->formatPerservingPrinter->printToString($newStmts, $oldStmts, $oldTokens);
$this->assertStringEqualsFile($this->fileInfo->getRealPath(), $processedFileContent);
} catch (Throwable $throwable) {
$this->markTestSkipped(sprintf(
'Test %s failed.',
__METHOD__
));
}
$processedFileContent = $this->formatPerservingPrinter->printToString($newStmts, $oldStmts, $oldTokens);
$this->assertStringEqualsFile($this->fileInfo->getRealPath(), $processedFileContent);
}
}