mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 00:23:50 +00:00
Raw integration of accompanying person (with respect of 'cahier de cahrge)
This commit is contained in:
@@ -55,8 +55,8 @@ class AccompanyingPeriodControllerTest extends WebTestCase
|
||||
*/
|
||||
protected static $em;
|
||||
|
||||
const OPENING_INPUT = 'chill_personbundle_accompanyingperiod[date_opening]';
|
||||
const CLOSING_INPUT = 'chill_personbundle_accompanyingperiod[date_closing]';
|
||||
const OPENING_INPUT = 'chill_personbundle_accompanyingperiod[openingDate]';
|
||||
const CLOSING_INPUT = 'chill_personbundle_accompanyingperiod[closingDate]';
|
||||
const CLOSING_MOTIVE_INPUT = 'chill_personbundle_accompanyingperiod[closingMotive]';
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase
|
||||
. 'motive into your periods fixtures');
|
||||
}
|
||||
|
||||
$period->setDateClosing(new \DateTime($periodDef['closingDate']))
|
||||
$period->setClosingDate(new \DateTime($periodDef['closingDate']))
|
||||
->setClosingMotive($periodDef['closingMotive']);
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ class AccompanyingPeriodTest extends \PHPUnit_Framework_TestCase
|
||||
$datetime2 = new \DateTime('tomorrow');
|
||||
|
||||
$period = new AccompanyingPeriod($datetime1);
|
||||
$period->setDateClosing($datetime2);
|
||||
$period->setClosingDate($datetime2);
|
||||
|
||||
$r = $period->isClosingAfterOpening();
|
||||
|
||||
@@ -44,7 +44,7 @@ class AccompanyingPeriodTest extends \PHPUnit_Framework_TestCase
|
||||
$datetime2 = new \DateTime('now');
|
||||
|
||||
$period = new AccompanyingPeriod($datetime1);
|
||||
$period->setDateClosing($datetime2);
|
||||
$period->setClosingDate($datetime2);
|
||||
|
||||
$this->assertFalse($period->isClosingAfterOpening());
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class AccompanyingPeriodTest extends \PHPUnit_Framework_TestCase
|
||||
$datetime = new \DateTime('now');
|
||||
|
||||
$period = new AccompanyingPeriod($datetime);
|
||||
$period->setDateClosing($datetime);
|
||||
$period->setClosingDate($datetime);
|
||||
|
||||
$this->assertTrue($period->isClosingAfterOpening());
|
||||
}
|
||||
@@ -66,7 +66,7 @@ class AccompanyingPeriodTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testIsClosed() {
|
||||
$period = new AccompanyingPeriod(new \DateTime());
|
||||
$period->setDateClosing(new \DateTime('tomorrow'));
|
||||
$period->setClosingDate(new \DateTime('tomorrow'));
|
||||
|
||||
$this->assertFalse($period->isOpen());
|
||||
}
|
||||
|
@@ -44,10 +44,10 @@ class PersonTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertInstanceOf('Chill\PersonBundle\Entity\AccompanyingPeriod', $period);
|
||||
$this->assertTrue($period->isOpen());
|
||||
$this->assertEquals($d, $period->getDateOpening());
|
||||
$this->assertEquals($d, $period->getOpeningDate());
|
||||
|
||||
//close and test
|
||||
$period->setDateClosing(new \DateTime('tomorrow'));
|
||||
$period->setClosingDate(new \DateTime('tomorrow'));
|
||||
|
||||
$shouldBeNull = $p->getCurrentAccompanyingPeriod();
|
||||
$this->assertNull($shouldBeNull);
|
||||
@@ -63,19 +63,19 @@ class PersonTest extends \PHPUnit_Framework_TestCase
|
||||
$p = new Person($d);
|
||||
|
||||
$e = new \DateTime("2013/3/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setDateClosing($e);
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
|
||||
$p->close($period);
|
||||
|
||||
$f = new \DateTime("2013/1/1");
|
||||
$p->open(new AccompanyingPeriod($f));
|
||||
|
||||
$g = new \DateTime("2013/4/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setDateClosing($g);
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($g);
|
||||
$p->close($period);
|
||||
|
||||
$r = $p->getAccompanyingPeriodsOrdered();
|
||||
|
||||
$date = $r[0]->getDateOpening()->format('Y-m-d');
|
||||
$date = $r[0]->getOpeningDate()->format('Y-m-d');
|
||||
|
||||
$this->assertEquals($date, '2013-01-01');
|
||||
}
|
||||
@@ -89,19 +89,19 @@ class PersonTest extends \PHPUnit_Framework_TestCase
|
||||
$p = new Person($d);
|
||||
|
||||
$g = new \DateTime("2013/4/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setDateClosing($g);
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($g);
|
||||
$p->close($period);
|
||||
|
||||
$f = new \DateTime("2013/2/1");
|
||||
$p->open(new AccompanyingPeriod($f));
|
||||
|
||||
$e = new \DateTime("2013/3/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setDateClosing($e);
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
|
||||
$p->close($period);
|
||||
|
||||
$r = $p->getAccompanyingPeriodsOrdered();
|
||||
|
||||
$date = $r[0]->getDateClosing()->format('Y-m-d');
|
||||
$date = $r[0]->getClosingDate()->format('Y-m-d');
|
||||
|
||||
$this->assertEquals($date, '2013-03-01');
|
||||
}
|
||||
@@ -116,14 +116,14 @@ class PersonTest extends \PHPUnit_Framework_TestCase
|
||||
$p = new Person($d);
|
||||
|
||||
$e = new \DateTime("2013/3/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setDateClosing($e);
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
|
||||
$p->close($period);
|
||||
|
||||
$f = new \DateTime("2013/1/1");
|
||||
$p->open(new AccompanyingPeriod($f));
|
||||
|
||||
$g = new \DateTime("2013/4/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setDateClosing($g);
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($g);
|
||||
$p->close($period);
|
||||
|
||||
$r = $p->checkAccompanyingPeriodsAreNotCollapsing();
|
||||
@@ -141,7 +141,7 @@ class PersonTest extends \PHPUnit_Framework_TestCase
|
||||
$p = new Person($d);
|
||||
|
||||
$e = new \DateTime("2013/3/1");
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setDateClosing($e);
|
||||
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
|
||||
$p->close($period);
|
||||
|
||||
$f = new \DateTime("2013/1/1");
|
||||
|
Reference in New Issue
Block a user