X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Ftest%2FParserTestCase.php;h=a0740b66367d9ea34a800339152ad9cb7b2bd23f;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=f3627a2a4a7c835908518f3d61ff59bc27bbf607;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/vendor/psy/psysh/test/ParserTestCase.php b/vendor/psy/psysh/test/ParserTestCase.php index f3627a2a4..a0740b663 100644 --- a/vendor/psy/psysh/test/ParserTestCase.php +++ b/vendor/psy/psysh/test/ParserTestCase.php @@ -21,6 +21,13 @@ class ParserTestCase extends \PHPUnit\Framework\TestCase private $parser; private $printer; + public function tearDown() + { + $this->traverser = null; + $this->parser = null; + $this->printer = null; + } + protected function parse($code, $prefix = 'parse($from); $stmts = $this->traverse($stmts); - $this->assertSame($to, $this->prettyPrint($stmts)); + $toStmts = $this->parse($to); + $this->assertSame($this->prettyPrint($toStmts), $this->prettyPrint($stmts)); } private function getParser() @@ -84,6 +92,6 @@ class ParserTestCase extends \PHPUnit\Framework\TestCase { $msg = $e->getRawMessage(); - return ($msg === 'Unexpected token EOF') || (strpos($msg, 'Syntax error, unexpected EOF') !== false); + return ($msg === 'Unexpected token EOF') || (\strpos($msg, 'Syntax error, unexpected EOF') !== false); } }