mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
Fix client request on POST poll (new poll).
This commit is contained in:
parent
da0078e547
commit
44c41e88da
@ -129,31 +129,33 @@ class PollControllerTest extends WebTestCase {
|
|||||||
'App\DataFixtures\AppPollFixtures'
|
'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/', [
|
$client->request('POST', '/api/v1/poll/', [
|
||||||
'json' => [
|
'json' => $data
|
||||||
"title" => "Fromage ou dessert ? ",
|
], [], [], json_encode($data));
|
||||||
"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
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
|
|
||||||
$response = $client->getResponse();
|
$response = $client->getResponse();
|
||||||
$this->assertEquals(201, $response->getStatusCode());
|
$this->assertEquals(201, $response->getStatusCode());
|
||||||
|
Loading…
Reference in New Issue
Block a user