diff --git a/tests/Functional/PollControllerTest.php b/tests/Functional/PollControllerTest.php index 1efe4a1..acfded9 100644 --- a/tests/Functional/PollControllerTest.php +++ b/tests/Functional/PollControllerTest.php @@ -129,31 +129,33 @@ class PollControllerTest extends WebTestCase { 'App\DataFixtures\AppPollFixtures' )); + $data = [ + "title" => "Fromage ou dessert ? ", + "description" => "Votre plat préféré", + "creation_date" => "2048-04-25T16:19:48+02:00", + "expiracy_date" => "2048-04-25T16:19:48+02:00", + "kind" => "text", + "allowed_answers" => [ + "yes" + ], + "modification_policy" => "nobody", + "mail_on_vote" => true, + "choices" => [ + [ + "id" => 1, + "name" => "fromage" + ], + [ + "id" => 2, + "name" => "dessert" + ] + ], + "default_expiracy_days_from_now" => 365 + ]; + $client->request('POST', '/api/v1/poll/', [ - 'json' => [ - "title" => "Fromage ou dessert ? ", - "description" => "Votre plat préféré", - "creation_date" => "2048-04-25T16:19:48+02:00", - "expiracy_date" => "2048-04-25T16:19:48+02:00", - "kind" => "text", - "allowed_answers" => [ - "yes" - ], - "modification_policy" => "nobody", - "mail_on_vote" => true, - "choices" => [ - [ - "id" => 1, - "name" => "fromage" - ], - [ - "id" => 2, - "name" => "dessert" - ] - ], - "default_expiracy_days_from_now" => 365 - ] - ]); + 'json' => $data + ], [], [], json_encode($data)); $response = $client->getResponse(); $this->assertEquals(201, $response->getStatusCode());