From ac74ba7e4281a695833ba3d1af13322b3ad6fba1 Mon Sep 17 00:00:00 2001 From: Albin Date: Sun, 12 Nov 2023 21:25:36 +0100 Subject: [PATCH] feat (afup#1110): functional test API pour event : - Planning - Programmee - Speakers - Ical --- db/seeds/Event.php | 3 +- db/seeds/Session.php | 14 ++++++-- tests/behat/features/Api/Api.feature | 51 ++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 tests/behat/features/Api/Api.feature diff --git a/db/seeds/Event.php b/db/seeds/Event.php index 93aa20476..f74d5fc2a 100644 --- a/db/seeds/Event.php +++ b/db/seeds/Event.php @@ -40,7 +40,8 @@ public function run() 'date_fin_saisie_repas_speakers' => $event - $oneDayInSeconds * 7, 'date_fin_saisie_nuites_hotel' => $event - $oneDayInSeconds * 7, 'place_name' => 'Paris', - 'place_address' => 'Marriott Rive Gauche' + 'place_address' => 'Marriott Rive Gauche', + 'date_annonce_planning' => date('Y-m-d', $event), ], ]; diff --git a/db/seeds/Session.php b/db/seeds/Session.php index e006e769a..6ba185d68 100644 --- a/db/seeds/Session.php +++ b/db/seeds/Session.php @@ -81,7 +81,7 @@ public function run() 'language_code' => 'fr', 'markdown' => 1, 'joindin' => 24041, - 'date_publication' => $date->format('Y-m-d H:i:s') + 'date_publication' => (new \DateTime())->modify('+5 days')->format('Y-m-d H:i:s') ], ]; @@ -111,6 +111,16 @@ public function run() ->save() ; + $table = $this->table('afup_forum_salle'); + $table->truncate(); + + $table + ->insert([ + 'id' => 1, + 'nom' => 'La salle T', + 'id_forum' => Event::ID_FORUM, + ]) + ->save(); $i = 1; $plannings = []; @@ -120,7 +130,7 @@ public function run() 'id_session' => $session['session_id'], 'debut' => $dateDebut->format('U'), 'fin' => $date->format('U'), - 'id_salle' => 0, + 'id_salle' => 1, 'id_forum' => Event::ID_FORUM, 'keynote' => '' ]; diff --git a/tests/behat/features/Api/Api.feature b/tests/behat/features/Api/Api.feature new file mode 100644 index 000000000..a5d8266fa --- /dev/null +++ b/tests/behat/features/Api/Api.feature @@ -0,0 +1,51 @@ +Feature: API pour event + + @reloadDbWithTestData + Scenario: Liste du programme sans filtre + Given I am on "/blog/forum/program?apply-publication-date-filters=0&speakers-page-prefix=/forum/conferencier-e-s/" + Then the response should contain "