From fd596a0b3945b0b145c8bcdafcdb7d4e990d0656 Mon Sep 17 00:00:00 2001 From: SilverFire - Dmitry Naumenko Date: Mon, 22 Oct 2018 16:10:42 +0300 Subject: [PATCH] Added tests --- tests/Whoops/Exception/FrameTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Whoops/Exception/FrameTest.php b/tests/Whoops/Exception/FrameTest.php index 72c6250..5356c6f 100644 --- a/tests/Whoops/Exception/FrameTest.php +++ b/tests/Whoops/Exception/FrameTest.php @@ -103,6 +103,20 @@ class FrameTest extends TestCase $this->assertStringEqualsFile($data['file'], $frame->getFileContents()); } + /** + * @covers Whoops\Exception\Frame::getFileContents + * @testWith ["[internal]"] + * ["Unknown"] + * @see https://github.com/filp/whoops/pull/599 + */ + public function testGetFileContentsWhenFrameIsNotRelatedToSpecificFile($fakeFilename) + { + $data = array_merge($this->getFrameData(), ['file' => $fakeFilename]); + $frame = $this->getFrameInstance($data); + + $this->assertNull($frame->getFileContents()); + } + /** * @covers Whoops\Exception\Frame::getFileLines */