mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
fix tests
This commit is contained in:
@@ -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");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user