Improve person accompanyingPeriod validation - close #410

This commit is contained in:
Marc Ducobu
2015-03-06 20:36:21 +01:00
parent c80326d0ed
commit 5634a19174
5 changed files with 110 additions and 158 deletions

View File

@@ -126,9 +126,9 @@ class PersonTest extends \PHPUnit_Framework_TestCase
$period = $p->getCurrentAccompanyingPeriod()->setDateClosing($g);
$p->close($period);
$r = $p->checkAccompanyingPeriodIsNotCovering();
$r = $p->checkAccompanyingPeriodsAreNotCollapsing();
$this->assertEquals($r['result'], Person::ERROR_OPENING_IS_INSIDE_CLOSING);
$this->assertEquals($r['result'], Person::ERROR_PERIODS_ARE_COLLAPSING);
}
/**
@@ -147,8 +147,8 @@ class PersonTest extends \PHPUnit_Framework_TestCase
$f = new \DateTime("2013/1/1");
$p->open(new AccompanyingPeriod($f));
$r = $p->checkAccompanyingPeriodIsNotCovering();
$r = $p->checkAccompanyingPeriodsAreNotCollapsing();
$this->assertEquals($r['result'], Person::ERROR_OPENING_NOT_CLOSED_IS_BEFORE_NEW_LINE);
$this->assertEquals($r['result'], Person::ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD);
}
}