diff --git a/tests/functional/Builder/BuilderTestCase.php b/tests/functional/Builder/BuilderTestCase.php index 2a0606c..393f8a9 100644 --- a/tests/functional/Builder/BuilderTestCase.php +++ b/tests/functional/Builder/BuilderTestCase.php @@ -35,46 +35,4 @@ public function pipelineRunner(): PipelineRunnerInterface { return new PipelineRunner(); } - - protected function assertNodeIsInstanceOf(string $expected, DefaultBuilder $builder, string $message = ''): void - { - $printer = new PrettyPrinter\Standard(); - - try { - $filename = sha1(random_bytes(128)) .'.php'; - $file = new vfsStreamFile($filename); - $file->setContent($printer->prettyPrintFile([ - new Node\Stmt\Return_($builder->getNode()), - ])); - $this->fs->addChild($file); - - $actual = include vfsStream::url('root/'.$filename); - } catch (\ParseError $exception) { - echo $printer->prettyPrintFile([$builder->getNode()]); - $this->fail($exception->getMessage()); - } - - $this->assertInstanceOf($expected, $actual, $message); - } - - protected function assertNodeIsNotInstanceOf(string $expected, DefaultBuilder $builder, string $message = ''): void - { - $printer = new PrettyPrinter\Standard(); - - try { - $filename = sha1(random_bytes(128)) .'.php'; - $file = new vfsStreamFile($filename); - $file->setContent($printer->prettyPrintFile([ - new Node\Stmt\Return_($builder->getNode()), - ])); - $this->fs->addChild($file); - - $actual = include vfsStream::url('root/'.$filename); - } catch (\ParseError $exception) { - echo $printer->prettyPrintFile([$builder->getNode()]); - $this->fail($exception->getMessage()); - } - - $this->assertNotInstanceOf($expected, $actual, $message); - } }