work on user render test

This commit is contained in:
Julie Lenaerts 2024-01-29 15:07:27 +01:00
parent c3a799cb7d
commit 8d58805abd

View File

@ -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