mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
work on user render test
This commit is contained in:
parent
aa2a398f9e
commit
0e3de2ec8a
@ -16,6 +16,10 @@ use Twig\Environment;
|
|||||||
|
|
||||||
class UserRenderTest extends TestCase
|
class UserRenderTest extends TestCase
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @throws \DateInvalidTimeZoneException
|
||||||
|
* @throws \DateMalformedStringException
|
||||||
|
*/
|
||||||
public function renderUserWithJobAndScopeAtCertainDateTest(): void
|
public function renderUserWithJobAndScopeAtCertainDateTest(): void
|
||||||
{
|
{
|
||||||
// Create a user with a certain user job
|
// Create a user with a certain user job
|
||||||
@ -27,23 +31,27 @@ class UserRenderTest extends TestCase
|
|||||||
$userJob->setLabel(['fr' => 'assistant social']);
|
$userJob->setLabel(['fr' => 'assistant social']);
|
||||||
$scope->setName(['fr' => 'service A']);
|
$scope->setName(['fr' => 'service A']);
|
||||||
$user->setLabel('BOB ISLA');
|
$user->setLabel('BOB ISLA');
|
||||||
|
|
||||||
$userJobHistory = (new User\UserJobHistory())
|
$userJobHistory = (new User\UserJobHistory())
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setJob($userJob)
|
->setJob($userJob)
|
||||||
//setStartDate
|
//setStartDate
|
||||||
;
|
;
|
||||||
|
|
||||||
|
$userScopeHistory = (new User\UserScopeHistory())
|
||||||
|
->setUser($user)
|
||||||
|
->setScope($scope)
|
||||||
|
;
|
||||||
$user->getUserJobHistories()->add($userJobHistory);
|
$user->getUserJobHistories()->add($userJobHistory);
|
||||||
$user->setMainScope($scope);
|
$user->setMainScope($scope);
|
||||||
|
|
||||||
// Change the user job
|
/* // Change the user job
|
||||||
$userJobTwo = new UserJob();
|
$userJobTwo = new UserJob();
|
||||||
$userJobTwo->setLabel(['fr' => 'directrice']);
|
$userJobTwo->setLabel(['fr' => 'directrice']);
|
||||||
/* this automatically creates a UserJobHistory. How to set the date manually though? **/
|
|
||||||
|
|
||||||
// Change the scope
|
// Change the scope
|
||||||
$scopeTwo = new Scope();
|
$scopeTwo = new Scope();
|
||||||
$scopeTwo->setName(['fr' => 'service B']);
|
$scopeTwo->setName(['fr' => 'service B']);*/
|
||||||
/* this automatically creates a UserScopeHistory. How to set the date manually though? **/
|
|
||||||
|
|
||||||
|
|
||||||
// Create renderer
|
// Create renderer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user