From 0e3de2ec8af575d71572eab0d1e2626ffb56508c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 29 Jan 2024 15:07:27 +0100 Subject: [PATCH] work on user render test --- .../Tests/Templating/Entity/UserRenderTest.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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