mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
make CloningNodeVistior fail
This commit is contained in:
parent
30fed31ca5
commit
9c74e03d8c
@ -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"
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user