mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 04:53:49 +00:00
Remove creation of AccompanyingPeriod on person creation
This commit is contained in:
@@ -45,11 +45,12 @@ class PersonTest extends \PHPUnit\Framework\TestCase
|
||||
public function testGetCurrentAccompanyingPeriod()
|
||||
{
|
||||
$d = new \DateTime('yesterday');
|
||||
$p = new Person($d);
|
||||
$p = new Person();
|
||||
$p->addAccompanyingPeriod(new AccompanyingPeriod($d));
|
||||
|
||||
$period = $p->getCurrentAccompanyingPeriod();
|
||||
|
||||
$this->assertInstanceOf('Chill\PersonBundle\Entity\AccompanyingPeriod', $period);
|
||||
$this->assertInstanceOf(AccompanyingPeriod::class, $period);
|
||||
$this->assertTrue($period->isOpen());
|
||||
$this->assertEquals($d, $period->getOpeningDate());
|
||||
|
||||
@@ -67,7 +68,8 @@ class PersonTest extends \PHPUnit\Framework\TestCase
|
||||
public function testAccompanyingPeriodOrderWithUnorderedAccompanyingPeriod()
|
||||
{
|
||||
$d = new \DateTime("2013/2/1");
|
||||
$p = new Person($d);
|
||||
$p = new Person();
|
||||
$p->addAccompanyingPeriod(new AccompanyingPeriod($d));
|
||||
|
||||
$e = new \DateTime("2013/3/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
|
||||
@@ -93,7 +95,8 @@ class PersonTest extends \PHPUnit\Framework\TestCase
|
||||
*/
|
||||
public function testAccompanyingPeriodOrderSameDateOpening() {
|
||||
$d = new \DateTime("2013/2/1");
|
||||
$p = new Person($d);
|
||||
$p = new Person();
|
||||
$p->addAccompanyingPeriod(new AccompanyingPeriod($d));
|
||||
|
||||
$g = new \DateTime("2013/4/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($g);
|
||||
@@ -120,7 +123,8 @@ class PersonTest extends \PHPUnit\Framework\TestCase
|
||||
*/
|
||||
public function testDateCoveringWithCoveringAccompanyingPeriod() {
|
||||
$d = new \DateTime("2013/2/1");
|
||||
$p = new Person($d);
|
||||
$p = new Person();
|
||||
$p->addAccompanyingPeriod(new AccompanyingPeriod($d));
|
||||
|
||||
$e = new \DateTime("2013/3/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
|
||||
@@ -145,7 +149,8 @@ class PersonTest extends \PHPUnit\Framework\TestCase
|
||||
*/
|
||||
public function testNotOpenAFileReOpenedLater() {
|
||||
$d = new \DateTime("2013/2/1");
|
||||
$p = new Person($d);
|
||||
$p = new Person();
|
||||
$p->addAccompanyingPeriod(new AccompanyingPeriod($d));
|
||||
|
||||
$e = new \DateTime("2013/3/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
|
||||
|
Reference in New Issue
Block a user