changelog updated and stylefix

This commit is contained in:
Julie Lenaerts 2021-12-02 12:49:33 +01:00
parent f971dc05eb
commit acacef936c
2 changed files with 18 additions and 16 deletions

View File

@ -24,6 +24,7 @@ and this project adheres to
* add an endpoint for checking permissions. See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/232
* [activity] for a new activity: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
* [calendar] for a new rdv: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
* [period] Validation added when period is confidential and confirmed -> user cannot be null.
## Test releases

View File

@ -14,10 +14,12 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Validator\Validator\ValidatorInterface;
/**
* @internal
* @coversNothing
*/
class AccompanyingPeriodConfidentialTest extends KernelTestCase
{
protected static $validator;
public static function setUpBeforeClass()
@ -27,22 +29,9 @@ class AccompanyingPeriodConfidentialTest extends KernelTestCase
self::$validator = self::$container->get(ValidatorInterface::class);
}
public function testConfidentialValid()
{
$period = new AccompanyingPeriod;
$period->setConfidential(true);
$period->setStep('CONFIRMED');
$period->setUser(new User());
$violations = self::$validator->validate($period, []);
$this->assertCount(0, $violations);
}
public function testConfidentialInvalid()
{
$period = new AccompanyingPeriod;
$period = new AccompanyingPeriod();
$period->setConfidential(true);
$period->setStep('CONFIRMED');
@ -50,4 +39,16 @@ class AccompanyingPeriodConfidentialTest extends KernelTestCase
$this->assertCount(1, $violations);
}
public function testConfidentialValid()
{
$period = new AccompanyingPeriod();
$period->setConfidential(true);
$period->setStep('CONFIRMED');
$period->setUser(new User());
$violations = self::$validator->validate($period, []);
$this->assertCount(0, $violations);
}
}