Skip to content

Commit

Permalink
Tests fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasHermanek committed May 29, 2024
1 parent 0d8aa36 commit e2ac82e
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/data/Fixtures/UserFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace AnzuSystems\CoreDamBundle\Tests\Data\Fixtures;

use AnzuSystems\CommonBundle\DataFixtures\Fixtures\AbstractFixtures;
use AnzuSystems\CoreDamBundle\App;
use AnzuSystems\CoreDamBundle\DataFixtures\AssetLicenceFixtures as BaseAssetLicenceFixtures;
use AnzuSystems\CoreDamBundle\Domain\User\UserManager;
use AnzuSystems\CoreDamBundle\Tests\Data\Entity\User;
Expand Down Expand Up @@ -53,20 +54,36 @@ private function getData(): Generator
$licenceBlog = $this->assetLicenceFixtures->getOneFromRegistry(AssetLicenceFixtures::LICENCE_ID);
$licenceCms = $this->baseAssetLicenceFixtures->getOneFromRegistry(BaseAssetLicenceFixtures::DEFAULT_LICENCE_ID);

yield (new User())
$userBlog = (new User())
->setId(User::ID_BLOG_USER)
->setEmail('[email protected]')
->setAssetLicences(new ArrayCollection([$licenceCms, $licenceBlog]))
->setUserToExtSystems(new ArrayCollection([$licenceCms->getExtSystem(), $licenceBlog->getExtSystem()]))
->setEnabled(true)
->setCreatedAt(App::getAppDate())
->setModifiedAt(App::getAppDate())
;
$userBlog
->setCreatedBy($userBlog)
->setModifiedBy($userBlog)
;

yield $userBlog;

yield (new User())
$userCms = (new User())
->setId(User::ID_CMS_USER)
->setEmail('[email protected]')
->setAssetLicences(new ArrayCollection([$licenceCms]))
->setUserToExtSystems(new ArrayCollection([$licenceCms->getExtSystem()]))
->setEnabled(true)
->setCreatedAt(App::getAppDate())
->setModifiedAt(App::getAppDate())
;
$userCms
->setCreatedBy($userCms)
->setModifiedBy($userCms)
;

yield $userCms;
}
}

0 comments on commit e2ac82e

Please sign in to comment.