From 9c74e03d8c2015d00c6c426fcf27602b76524625 Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Sat, 28 Oct 2017 16:59:20 +0200 Subject: [PATCH] make CloningNodeVistior fail --- composer.json | 2 +- .../tests/NodeTraverserQueueTest.php | 22 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 75e79889f88..47217ae040f 100644 --- a/composer.json +++ b/composer.json @@ -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" diff --git a/packages/NodeTraverserQueue/tests/NodeTraverserQueueTest.php b/packages/NodeTraverserQueue/tests/NodeTraverserQueueTest.php index ddc1e975c83..765988555d5 100644 --- a/packages/NodeTraverserQueue/tests/NodeTraverserQueueTest.php +++ b/packages/NodeTraverserQueue/tests/NodeTraverserQueueTest.php @@ -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); } }