From b88765c344bfd1c9f1f38ba9cdf6bafc3690e639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 26 May 2021 22:57:00 +0200 Subject: [PATCH] fix tests --- phpunit.xml.dist | 2 - .../AccompanyingPeriodControllerTest.php | 40 +++++++++---------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 62f1585fc..c1d539f84 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -18,7 +18,6 @@ src/Bundle/ChillMainBundle/Tests/ - @@ -30,7 +29,6 @@ src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php - --> diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php index 40f4936b4..eecb26a46 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php @@ -148,7 +148,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase * Test the closing of a periods * * Given that a person as an accompanying period opened since 2015-01-05 - * and we fill the close form (at /en/person/[id]/accompanying-period/close + * and we fill the close form (at /fr/person/[id]/accompanying-period/close * with : dateClosing: 2015-02-01 * with : the last closing motive in list * Then the response should redirect to period view @@ -158,10 +158,10 @@ class AccompanyingPeriodControllerTest extends WebTestCase */ public function testClosingCurrentPeriod() { - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/close'); - - $form = $crawler->selectButton('Close accompanying period')->form(); + + $form = $crawler->selectButton('Clôre la période')->form(); $form->get(self::CLOSING_MOTIVE_INPUT) ->setValue($this->getLastValueOnClosingMotive($form)); @@ -171,7 +171,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase $cr = $this->client->submit($form); $this->assertTrue($this->client->getResponse()->isRedirect( - '/en/person/'.$this->person->getId().'/accompanying-period'), + '/fr/person/'.$this->person->getId().'/accompanying-period'), 'the server redirects to /accompanying-period page'); $this->assertGreaterThan(0, $this->client->followRedirect() ->filter('.success')->count(), @@ -182,7 +182,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase * Test the closing of a periods * * Given that a person as an accompanying period opened since 2015-01-05 - * and we fill the close form (at /en/person/[id]/accompanying-period/close + * and we fill the close form (at /fr/person/[id]/accompanying-period/close * with : dateClosing: 2014-01-01 * with : the last closing motive in list * Then the response should redirect to period view @@ -192,10 +192,10 @@ class AccompanyingPeriodControllerTest extends WebTestCase */ public function testClosingCurrentPeriodWithDateClosingBeforeOpeningFails() { - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/close'); - $form = $crawler->selectButton('Close accompanying period')->form(); + $form = $crawler->selectButton('Clôre la période')->form(); $form->get(self::CLOSING_MOTIVE_INPUT) ->setValue($this->getLastValueOnClosingMotive($form)); @@ -223,10 +223,10 @@ class AccompanyingPeriodControllerTest extends WebTestCase */ public function testAddNewPeriodBeforeActual() { - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/create'); - $form = $crawler->selectButton('Create an accompanying period')->form(); + $form = $crawler->selectButton('Créer une période d\'accompagnement')->form(); $form->get(self::CLOSING_MOTIVE_INPUT) ->setValue($this->getLastValueOnClosingMotive($form)); $form->get(self::CLOSING_INPUT) @@ -237,7 +237,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase $this->client->submit($form); $this->assertTrue($this->client->getResponse()->isRedirect( - '/en/person/'.$this->person->getId().'/accompanying-period'), + '/fr/person/'.$this->person->getId().'/accompanying-period'), 'the server redirects to /accompanying-period page'); $this->assertGreaterThan(0, $this->client->followRedirect() ->filter('.success')->count(), @@ -257,10 +257,10 @@ class AccompanyingPeriodControllerTest extends WebTestCase */ public function testCreatePeriodWithClosingAfterCurrentFails() { - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/create'); - $form = $crawler->selectButton('Create an accompanying period')->form(); + $form = $crawler->selectButton("Créer une période d'accompagnement")->form(); $form->get(self::CLOSING_MOTIVE_INPUT) ->setValue($this->getLastValueOnClosingMotive($form)); $form->get(self::CLOSING_INPUT) @@ -289,10 +289,10 @@ class AccompanyingPeriodControllerTest extends WebTestCase */ public function testCreatePeriodWithOpeningAndClosingAfterCurrentFails() { - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/create'); - $form = $crawler->selectButton('Create an accompanying period')->form(); + $form = $crawler->selectButton("Créer une période d'accompagnement")->form(); $form->get(self::CLOSING_MOTIVE_INPUT) ->setValue($this->getLastValueOnClosingMotive($form)); $form->get(self::CLOSING_INPUT) @@ -330,7 +330,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase ] )); - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/create'); $form = $crawler->selectButton('Create an accompanying period')->form();; @@ -361,7 +361,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase */ public function testCreatePeriodWithClosingBeforeOpeningFails() { - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/create'); $form = $crawler->selectButton('Create an accompanying period')->form(); @@ -403,7 +403,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase ] )); - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/create'); $form = $crawler->selectButton('Create an accompanying period')->form(); @@ -444,7 +444,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase ] )); - $crawler = $this->client->request('GET', '/en/person/' + $crawler = $this->client->request('GET', '/fr/person/' .$this->person->getId().'/accompanying-period/create'); $form = $crawler->selectButton('Create an accompanying period')->form(); @@ -523,4 +523,4 @@ class AccompanyingPeriodControllerTest extends WebTestCase "Test the response is a redirection => the period is re-opened"); } -} \ No newline at end of file +}