mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-11-04 03:08:25 +00:00 
			
		
		
		
	fix tests
This commit is contained in:
		@@ -18,7 +18,6 @@
 | 
			
		||||
       <testsuite name="MainBundle">
 | 
			
		||||
         <directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory>
 | 
			
		||||
       </testsuite>
 | 
			
		||||
       <!-- remove tests for person temporarily 
 | 
			
		||||
       <testsuite name="PersonBundle">
 | 
			
		||||
         <directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory>
 | 
			
		||||
         <!-- test for export will be runned later -->
 | 
			
		||||
@@ -30,7 +29,6 @@
 | 
			
		||||
         <!-- find a solution to create multiple configs -->
 | 
			
		||||
         <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php</exclude>
 | 
			
		||||
        </testsuite>
 | 
			
		||||
        -->
 | 
			
		||||
    </testsuites>
 | 
			
		||||
 | 
			
		||||
    <listeners>
 | 
			
		||||
 
 | 
			
		||||
@@ -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