Check for object type before calling method, prevent fatal error in failing test.

This commit is contained in:
Sam Minnee 2013-02-25 16:33:55 +13:00
parent b2dfa77056
commit 88b3901a69

View File

@ -38,6 +38,7 @@ class ControllerTest extends FunctionalTest {
public function testUndefinedActions() {
$response = Director::test('ControllerTest_AccessUnsecuredSubController/undefinedaction');
$this->assertInstanceOf('SS_HTTPResponse', $response);
$this->assertEquals(404, $response->getStatusCode(), 'Undefined actions return a not found response.');
}