X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Ftest%2FException%2FParseErrorExceptionTest.php;fp=vendor%2Fpsy%2Fpsysh%2Ftest%2FException%2FParseErrorExceptionTest.php;h=446b9389c4dd8097b921f9f0f3d24017971a0499;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/psy/psysh/test/Exception/ParseErrorExceptionTest.php b/vendor/psy/psysh/test/Exception/ParseErrorExceptionTest.php new file mode 100644 index 000000000..446b9389c --- /dev/null +++ b/vendor/psy/psysh/test/Exception/ParseErrorExceptionTest.php @@ -0,0 +1,42 @@ +assertInstanceOf('Psy\Exception\Exception', $e); + $this->assertInstanceOf('PhpParser\Error', $e); + $this->assertInstanceOf('Psy\Exception\ParseErrorException', $e); + } + + public function testMessage() + { + $e = new ParseErrorException('{msg}', 1); + + $this->assertContains('{msg}', $e->getMessage()); + $this->assertContains('PHP Parse error:', $e->getMessage()); + } + + public function testConstructFromParseError() + { + $e = ParseErrorException::fromParseError(new \PhpParser\Error('{msg}')); + + $this->assertContains('{msg}', $e->getRawMessage()); + $this->assertContains('PHP Parse error:', $e->getMessage()); + } +}