mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix replacing an initial comment in accompanying period
This commit is contained in:
@@ -137,6 +137,7 @@ class AccompanyingPeriodTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
$period = new AccompanyingPeriod(new \DateTime());
|
||||
$comment = new Comment();
|
||||
$replacingComment = new Comment();
|
||||
|
||||
$period->setInitialComment(NULL);
|
||||
$this->assertNull($period->getInitialComment());
|
||||
@@ -146,9 +147,15 @@ class AccompanyingPeriodTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertSame($period, $comment->getAccompanyingPeriod());
|
||||
$this->assertEquals(0, count($period->getComments()), "The initial comment should not appears in the list of comments");
|
||||
|
||||
$period->setInitialComment($replacingComment);
|
||||
$this->assertSame($period->getInitialComment(), $replacingComment);
|
||||
$this->assertSame($period, $replacingComment->getAccompanyingPeriod());
|
||||
$this->assertEquals(0, count($period->getComments()), "The initial comment should not appears in the list of comments");
|
||||
$this->assertNull($comment->getAccompanyingPeriod());
|
||||
|
||||
$period->setInitialComment(NULL);
|
||||
$this->assertNull($period->getInitialComment());
|
||||
$this->assertNull($comment->getAccompanyingPeriod());
|
||||
$this->assertNull($replacingComment->getAccompanyingPeriod());
|
||||
$this->assertEquals(0, count($period->getComments()), "The initial comment should not appears in the list of comments");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user