ZF2 Testing: Failed asserting response code “302”, actual status code is “500”
问题 I am implementing PHPUnit tests for an AuthenticationController . When I test the /logout route: public function testLogoutActionCanBeAccessed() { $this->dispatch('/logout'); $this->assertResponseStatusCode(302); $this->assertModuleName('Main'); $this->assertControllerName('Main\Controller\Authentication'); $this->assertControllerClass('AuthenticationController'); $this->assertMatchedRouteName('logout'); } I get the following error message: There was 1 failure: 1) MainTest\Controller