Release 2.19 (#4922)
This commit is contained in:
@@ -12,6 +12,7 @@ namespace App\Tests\Validator\Constraints;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Project;
|
||||
use App\Entity\Timesheet;
|
||||
use App\Entity\User;
|
||||
use App\Model\QuickEntryModel as QuickEntryModelEntity;
|
||||
use App\Validator\Constraints\QuickEntryModel;
|
||||
use App\Validator\Constraints\QuickEntryModelValidator;
|
||||
@@ -47,7 +48,8 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
public function testTriggersOnMissingProjectAndActivity(): void
|
||||
{
|
||||
$model = new QuickEntryModelEntity();
|
||||
$user = new User();
|
||||
$model = new QuickEntryModelEntity($user);
|
||||
$timesheet = new Timesheet();
|
||||
$timesheet->setBegin(new \DateTime());
|
||||
$timesheet->setBegin(new \DateTime('+ 1 hour'));
|
||||
@@ -66,7 +68,8 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
public function testTriggersOnMissingActivity(): void
|
||||
{
|
||||
$model = new QuickEntryModelEntity();
|
||||
$user = new User();
|
||||
$model = new QuickEntryModelEntity($user);
|
||||
$model->setProject(new Project());
|
||||
$timesheet = new Timesheet();
|
||||
$timesheet->setBegin(new \DateTime());
|
||||
@@ -83,7 +86,8 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
public function testTriggersOnMissingProject(): void
|
||||
{
|
||||
$model = new QuickEntryModelEntity();
|
||||
$user = new User();
|
||||
$model = new QuickEntryModelEntity($user);
|
||||
$model->setActivity(new Activity());
|
||||
$timesheet = new Timesheet();
|
||||
$timesheet->setBegin(new \DateTime());
|
||||
@@ -100,7 +104,8 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
public function testDoesNotTriggerOnPrototype(): void
|
||||
{
|
||||
$model = new QuickEntryModelEntity();
|
||||
$user = new User();
|
||||
$model = new QuickEntryModelEntity($user);
|
||||
|
||||
$this->validator->validate($model, new QuickEntryModel());
|
||||
|
||||
@@ -109,7 +114,8 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
public function testDoesNotTriggerOnProperlyFilled(): void
|
||||
{
|
||||
$model = new QuickEntryModelEntity();
|
||||
$user = new User();
|
||||
$model = new QuickEntryModelEntity($user);
|
||||
$model->setActivity(new Activity());
|
||||
$model->setProject(new Project());
|
||||
$timesheet = new Timesheet();
|
||||
|
||||
Reference in New Issue
Block a user