php - Symfony Functional Testing: how to understand why the test fails (with a 500 Error) -
i'm writing functional tests controller registers new user in app.
the test i'm writing fails because of 500 http error.
i'm using
$response = $client->getresponse(); print_r($response->getcontent());exit;
to print html see happening html incomplete in console (phpstorm) don't know happening , cannot find error solve it.
any ideas how understand happening , causing error?
may these can help: there test.log
file in app/logs
folder, can remove it, run tests, when error happens open newly generated file, read happend, that's it.
or add debugbundle
registerbundles
method in appkernel.php
file, , use dump()
method, this:
// appkernel.php if (in_array($this->getenvironment(), ['dev', 'test'])) { ... $bundles[] = new \symfony\bundle\debugbundle\debugbundle(); } ***** // usage: public function testsomeaction() { ..... $response = $client->getresponse(); dump($response); die; }
Comments
Post a Comment