With my symfony 2 application, i am using phpunit to test if each controller's action response's status code is the expected one.
When not, how can I have phpunit display the error message that comes with the exception, or best, simulate a profiler exception page ?
The reason for this is I have an action returning a 500 code in phpunit but which loads just fine in my browser.
My code :
/**
* @dataProvider urlProvider
* @param $url
*/
public function testPageIsSuccessful($url)
{
$client = self::createClient(array(), array(
'PHP_AUTH_USER' => 'superadmin',
'PHP_AUTH_PW' => '587010',
));
$client->followRedirects();
$client->request('GET', $url);
var_dump($url);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
}
Thanks !
$foodMeUp).