public function testThrowsExceptionIfNoStoryVariableDefined() { // ---------------------------------------------------------------- // setup the test $filename = __DIR__ . '/test-stories/DoesNotDeclareStory.php'; $expectedCode = 500; $expectedMessage = "Story file '{$filename}' did not create the \$story variable"; // ---------------------------------------------------------------- // perform the change // this should throw an exception $caughtException = false; try { Story_Loader::loadStory($filename); } catch (Exception $e) { $caughtException = $e; } // ---------------------------------------------------------------- // test the results $this->assertTrue($caughtException instanceof E5xx_InvalidStoryFile); $this->assertEquals($expectedCode, $caughtException->getCode()); $this->assertEquals($expectedMessage, $caughtException->getMessage()); }