Constants

OPENING_INPUT

OPENING_INPUT

CLOSING_INPUT

CLOSING_INPUT

CLOSING_MOTIVE_INPUT

CLOSING_MOTIVE_INPUT

Properties

$client

$client : \Symfony\Component\BrowserKit\Client

Type

\Symfony\Component\BrowserKit\Client

$em

$em : \Doctrine\ORM\EntityManagerInterface

Type

\Doctrine\ORM\EntityManagerInterface

Methods

setUpBeforeClass()

setUpBeforeClass() 

setUp()

setUp() 

tearDown()

tearDown() 

testClosingCurrentPeriod()

testClosingCurrentPeriod() 

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

 with : dateClosing: 2015-02-01
 with : the last closing motive in list

Then the response should redirect to history view And the next page should have a .error element present in page

testClosingCurrentPeriodWithDateClosingBeforeOpeningFails()

testClosingCurrentPeriodWithDateClosingBeforeOpeningFails() 

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

 with : dateClosing: 2014-01-01
 with : the last closing motive in list

Then the response should redirect to history view And the next page should have a .error element present in page

testAddNewPeriodBeforeActual()

testAddNewPeriodBeforeActual() 

Test the creation of a new period

Given that a person as an accompanying period opened since 2015-01-05 and we create a new period

 with : dateClosing: 2014-12-31
 with : dateOpening: 2014-01-01
 with : the last closing motive in list

Then the response should redirect to history view

testCreatePeriodWithClosingAfterCurrentFails()

testCreatePeriodWithClosingAfterCurrentFails() 

Create a period with closing after current fails

Given that a person as an accompanying period opened since 2015-01-05 and we create a new period

 with : dateClosing: 2015-02-01 (after 2015-01-05)
 with : dateOpening: 2014-12-31
 with : the last closing motive in list

Then the response should not redirect to any page and an error element is shown

testCreatePeriodWithOpeningAndClosingAfterCurrentFails()

testCreatePeriodWithOpeningAndClosingAfterCurrentFails() 

Create a period after a current opened period fails

Given that a person as an accompanying period opened since 2015-01-05 and we create a new period

 with : dateClosing: 2015-03-01
 with : dateOpening: 2015-02-01
 with : the last closing motive in list

Then the response should not redirect to any page and an error element is shown

testCreatePeriodWithDateEndBetweenAnotherPeriodFails()

testCreatePeriodWithDateEndBetweenAnotherPeriodFails() 

create a period with date end between another period must fails

Given that a person as an accompanying period opened since 2015-01-05 and that this person has another accompanying period between 2014-01-01 and 2014-12-31 and we create a new period

 with : dateClosing: 2014-16-01
 with : dateOpening: 2013-01-01
 with : the last closing motive in list

Then the response should not redirect and a error element is shown on the response page

testCreatePeriodWithClosingBeforeOpeningFails()

testCreatePeriodWithClosingBeforeOpeningFails() 

create a period with date closing after opening fails

Given that a person as an accompanying period opened since 2015-01-05 and we create a new period

 with : dateClosing: 2014-01-01 (before opening)
 with : dateOpening: 2015-01-01
 with : the last closing motive in list

Then the response should redirect to history view

testCreatePeriodAfterOpeningFails()

testCreatePeriodAfterOpeningFails() 

create a period with date closing and date opening inside another period fails

Given that a person as an accompanying period opened since 2015-01-05 and that this person has another accompanying period between 2014-01-01 and 2014-12-31 and we create a new period

 with : dateClosing: 2014-02-01
 with : dateOpening: 2014-03-01
 with : the last closing motive in list

Then the response should not redirect and a error element is shown on the response page

testCreatePeriodWithDateOpeningBetweenAnotherPeriodFails()

testCreatePeriodWithDateOpeningBetweenAnotherPeriodFails() 

Create a period with dateOpening between another period must fails

Given that a person as an accompanying period opened since 2015-01-05 and that this person has another accompanying period between 2014-01-01 and 2014-12-31 and we create a new period

 with : dateClosing: 2015-01-01
 with : dateOpening: 2014-06-01
 with : the last closing motive in list

Then the response should not redirect and a error element is shown on the response page

generatePeriods()

generatePeriods(array  $periods) 

Parameters

array $periods

getLastValueOnClosingMotive()

getLastValueOnClosingMotive(\Symfony\Component\DomCrawler\Form  $form) 

Parameters

\Symfony\Component\DomCrawler\Form $form

getRandomClosingMotive()

getRandomClosingMotive()