Fix client request on POST poll (new poll).

This commit is contained in:
Sébastien Touzé 2020-05-23 18:37:09 +02:00
parent da0078e547
commit 44c41e88da
1 changed files with 26 additions and 24 deletions

View File

@ -129,8 +129,7 @@ class PollControllerTest extends WebTestCase {
'App\DataFixtures\AppPollFixtures' 'App\DataFixtures\AppPollFixtures'
)); ));
$client->request('POST', '/api/v1/poll/', [ $data = [
'json' => [
"title" => "Fromage ou dessert ? ", "title" => "Fromage ou dessert ? ",
"description" => "Votre plat préféré", "description" => "Votre plat préféré",
"creation_date" => "2048-04-25T16:19:48+02:00", "creation_date" => "2048-04-25T16:19:48+02:00",
@ -152,8 +151,11 @@ class PollControllerTest extends WebTestCase {
] ]
], ],
"default_expiracy_days_from_now" => 365 "default_expiracy_days_from_now" => 365
] ];
]);
$client->request('POST', '/api/v1/poll/', [
'json' => $data
], [], [], json_encode($data));
$response = $client->getResponse(); $response = $client->getResponse();
$this->assertEquals(201, $response->getStatusCode()); $this->assertEquals(201, $response->getStatusCode());