lundi 3 août 2015

PHPUnit Post request for a Symfony2 controller

I am writing a little test that "should" change a database value based on the post request I send, but I check my test database and clearly nothing is changing. I know this API works because I did a test using CURL through the CLI and it was not a problem.

 $crawler = $client->request('POST', '/api/hardware_version/00-11-22-33-44-55', array('hardware_version' => 10));

The post param variable name is correct, but nothing is changing. What's the best way to send a post request in a PHPUnit functional test?

Aucun commentaire:

Enregistrer un commentaire