mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
period: fix method hasPreviousUser and create method isChangedUser, and use it in Notification
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Tests\Entity;
|
||||
|
||||
use ArrayIterator;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
||||
@@ -62,6 +63,29 @@ final class AccompanyingPeriodTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertFalse($period->isClosingAfterOpening());
|
||||
}
|
||||
|
||||
public function testHasChangedUser()
|
||||
{
|
||||
$period = new AccompanyingPeriod();
|
||||
|
||||
$this->assertFalse($period->isChangedUser());
|
||||
$this->assertFalse($period->hasPreviousUser());
|
||||
|
||||
$period->setUser($user1 = new User());
|
||||
|
||||
$this->assertTrue($period->isChangedUser());
|
||||
$this->assertFalse($period->hasPreviousUser());
|
||||
|
||||
$period->resetPreviousUser();
|
||||
$this->assertFalse($period->isChangedUser());
|
||||
$this->assertFalse($period->hasPreviousUser());
|
||||
|
||||
$period->setUser($user2 = new User());
|
||||
|
||||
$this->assertTrue($period->isChangedUser());
|
||||
$this->assertTrue($period->hasPreviousUser());
|
||||
$this->assertSame($user1, $period->getPreviousUser());
|
||||
}
|
||||
|
||||
public function testHistoryLocation()
|
||||
{
|
||||
$period = new AccompanyingPeriod();
|
||||
|
Reference in New Issue
Block a user