diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index c7bbca342..21f73d466 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -16,6 +16,10 @@ use Twig\Environment; class UserRenderTest extends TestCase { + /** + * @throws \DateInvalidTimeZoneException + * @throws \DateMalformedStringException + */ public function renderUserWithJobAndScopeAtCertainDateTest(): void { // Create a user with a certain user job @@ -27,23 +31,27 @@ class UserRenderTest extends TestCase $userJob->setLabel(['fr' => 'assistant social']); $scope->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); + $userJobHistory = (new User\UserJobHistory()) ->setUser($user) ->setJob($userJob) //setStartDate ; + + $userScopeHistory = (new User\UserScopeHistory()) + ->setUser($user) + ->setScope($scope) + ; $user->getUserJobHistories()->add($userJobHistory); $user->setMainScope($scope); - // Change the user job +/* // Change the user job $userJobTwo = new UserJob(); $userJobTwo->setLabel(['fr' => 'directrice']); - /* this automatically creates a UserJobHistory. How to set the date manually though? **/ // Change the scope $scopeTwo = new Scope(); - $scopeTwo->setName(['fr' => 'service B']); - /* this automatically creates a UserScopeHistory. How to set the date manually though? **/ + $scopeTwo->setName(['fr' => 'service B']);*/ // Create renderer