mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
add initial comment to accompanying period
This commit is contained in:
@@ -25,6 +25,7 @@ namespace Chill\PersonBundle\Tests\Entity;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
||||
|
||||
class AccompanyingPeriodTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
@@ -131,4 +132,23 @@ class AccompanyingPeriodTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertNull($period->getRequestorPerson());
|
||||
$this->assertNull($period->getRequestor());
|
||||
}
|
||||
|
||||
public function testInitialComment()
|
||||
{
|
||||
$period = new AccompanyingPeriod(new \DateTime());
|
||||
$comment = new Comment();
|
||||
|
||||
$period->setInitialComment(NULL);
|
||||
$this->assertNull($period->getInitialComment());
|
||||
|
||||
$period->setInitialComment($comment);
|
||||
$this->assertSame($period->getInitialComment(), $comment);
|
||||
$this->assertSame($period, $comment->getAccompanyingPeriod());
|
||||
$this->assertEquals(0, count($period->getComments()), "The initial comment should not appears in the list of comments");
|
||||
|
||||
$period->setInitialComment(NULL);
|
||||
$this->assertNull($period->getInitialComment());
|
||||
$this->assertNull($comment->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