-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1caf350
commit f3e054a
Showing
27 changed files
with
1,135 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\DataFixtures\ModList; | ||
|
||
use App\DataFixtures\Dlc\CslaIronCurtainDlcFixture; | ||
use App\DataFixtures\Mod\Directory\ArmaScriptProfilerModFixture; | ||
use App\DataFixtures\Mod\Directory\Deprecated\R3ModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Optional\AceInteractionMenuExpansionModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Required\ArmaForcesMedicalModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Required\Broken\ArmaForcesAceMedicalModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Required\Deprecated\LegacyArmaForcesModsModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Required\Disabled\ArmaForcesJbadBuildingFixModFixture; | ||
use App\DataFixtures\ModGroup\CupModGroupFixture; | ||
use App\DataFixtures\User\User1Fixture; | ||
use App\Entity\ModList\ModList; | ||
use App\Test\Traits\TimeTrait; | ||
use Doctrine\Bundle\FixturesBundle\Fixture; | ||
use Doctrine\Common\DataFixtures\DependentFixtureInterface; | ||
use Doctrine\Persistence\ObjectManager; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class CupModListFixture extends Fixture implements DependentFixtureInterface | ||
{ | ||
use TimeTrait; | ||
|
||
public const ID = 'ea384489-c06c-4844-9e56-0e9a9c46bfaf'; | ||
public const NAME = 'CUP'; | ||
public const OWNER_ID = User1Fixture::ID; | ||
|
||
public function load(ObjectManager $manager): void | ||
{ | ||
$this->withTimeFrozenAt('2020-01-01T00:00:00+00:00', function () use ($manager): void { | ||
$modList = new ModList( | ||
Uuid::fromString(self::ID), | ||
self::NAME, | ||
null, | ||
[ | ||
$this->getReference(R3ModFixture::ID), | ||
$this->getReference(ArmaScriptProfilerModFixture::ID), | ||
|
||
$this->getReference(AceInteractionMenuExpansionModFixture::ID), | ||
$this->getReference(ArmaForcesAceMedicalModFixture::ID), | ||
$this->getReference(LegacyArmaForcesModsModFixture::ID), | ||
$this->getReference(ArmaForcesJbadBuildingFixModFixture::ID), | ||
$this->getReference(ArmaForcesMedicalModFixture::ID), | ||
], | ||
[ | ||
$this->getReference(CupModGroupFixture::ID), | ||
], | ||
[ | ||
$this->getReference(CslaIronCurtainDlcFixture::ID), | ||
], | ||
$this->getReference(self::OWNER_ID), | ||
true, | ||
false, | ||
); | ||
|
||
$manager->persist($modList); | ||
$manager->flush(); | ||
|
||
$this->addReference(self::ID, $modList); | ||
}); | ||
} | ||
|
||
public function getDependencies(): array | ||
{ | ||
return [ | ||
User1Fixture::class, // owner | ||
|
||
R3ModFixture::class, | ||
ArmaScriptProfilerModFixture::class, | ||
|
||
AceInteractionMenuExpansionModFixture::class, | ||
ArmaForcesAceMedicalModFixture::class, | ||
LegacyArmaForcesModsModFixture::class, | ||
ArmaForcesJbadBuildingFixModFixture::class, | ||
ArmaForcesMedicalModFixture::class, | ||
|
||
CupModGroupFixture::class, | ||
|
||
CslaIronCurtainDlcFixture::class, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\DataFixtures\ModList; | ||
|
||
use App\DataFixtures\Dlc\CslaIronCurtainDlcFixture; | ||
use App\DataFixtures\Mod\Directory\ArmaScriptProfilerModFixture; | ||
use App\DataFixtures\Mod\Directory\Deprecated\R3ModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Optional\AceInteractionMenuExpansionModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Required\ArmaForcesMedicalModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Required\Broken\ArmaForcesAceMedicalModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Required\Deprecated\LegacyArmaForcesModsModFixture; | ||
use App\DataFixtures\Mod\SteamWorkshop\Required\Disabled\ArmaForcesJbadBuildingFixModFixture; | ||
use App\DataFixtures\ModGroup\RhsModGroupFixture; | ||
use App\DataFixtures\User\User2Fixture; | ||
use App\Entity\ModList\ModList; | ||
use App\Test\Traits\TimeTrait; | ||
use Doctrine\Bundle\FixturesBundle\Fixture; | ||
use Doctrine\Common\DataFixtures\DependentFixtureInterface; | ||
use Doctrine\Persistence\ObjectManager; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class RhsModListFixture extends Fixture implements DependentFixtureInterface | ||
{ | ||
use TimeTrait; | ||
|
||
public const ID = 'c3b11c2f-9254-4262-bfde-3605df0149d4'; | ||
public const NAME = 'RHS'; | ||
public const OWNER_ID = User2Fixture::ID; | ||
|
||
public function load(ObjectManager $manager): void | ||
{ | ||
$this->withTimeFrozenAt('2020-01-01T00:00:00+00:00', function () use ($manager): void { | ||
$modList = new ModList( | ||
Uuid::fromString(self::ID), | ||
self::NAME, | ||
null, | ||
[ | ||
$this->getReference(R3ModFixture::ID), | ||
$this->getReference(ArmaScriptProfilerModFixture::ID), | ||
|
||
$this->getReference(AceInteractionMenuExpansionModFixture::ID), | ||
$this->getReference(ArmaForcesAceMedicalModFixture::ID), | ||
$this->getReference(LegacyArmaForcesModsModFixture::ID), | ||
$this->getReference(ArmaForcesJbadBuildingFixModFixture::ID), | ||
$this->getReference(ArmaForcesMedicalModFixture::ID), | ||
], | ||
[ | ||
$this->getReference(RhsModGroupFixture::ID), | ||
], | ||
[ | ||
$this->getReference(CslaIronCurtainDlcFixture::ID), | ||
], | ||
$this->getReference(self::OWNER_ID), | ||
false, | ||
false, | ||
); | ||
|
||
$manager->persist($modList); | ||
$manager->flush(); | ||
|
||
$this->addReference(self::ID, $modList); | ||
}); | ||
} | ||
|
||
public function getDependencies(): array | ||
{ | ||
return [ | ||
User2Fixture::class, // owner | ||
|
||
R3ModFixture::class, | ||
ArmaScriptProfilerModFixture::class, | ||
|
||
AceInteractionMenuExpansionModFixture::class, | ||
ArmaForcesAceMedicalModFixture::class, | ||
LegacyArmaForcesModsModFixture::class, | ||
ArmaForcesJbadBuildingFixModFixture::class, | ||
ArmaForcesMedicalModFixture::class, | ||
|
||
RhsModGroupFixture::class, | ||
|
||
CslaIronCurtainDlcFixture::class, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,11 @@ | |
use Doctrine\Persistence\ObjectManager; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class AdminUserFixture extends Fixture | ||
class AdminFixture extends Fixture | ||
{ | ||
public const ID = '31c9769f-4195-4fa8-b78d-0b54a1ceb8df'; | ||
public const USERNAME = 'admin#0'; | ||
public const EMAIL = '[email protected]'; | ||
|
||
public function load(ObjectManager $manager): void | ||
{ | ||
|
@@ -21,9 +23,9 @@ public function load(ObjectManager $manager): void | |
|
||
$user = new User( | ||
Uuid::fromString(self::ID), | ||
'admin#0', | ||
'[email protected]', | ||
self::ID, | ||
self::USERNAME, | ||
self::EMAIL, | ||
str_repeat('0', 18), | ||
$permissions, | ||
[], | ||
null, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,19 +10,21 @@ | |
use Doctrine\Persistence\ObjectManager; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class RegularUserFixture extends Fixture | ||
class User1Fixture extends Fixture | ||
{ | ||
public const ID = '03f6066e-2fe9-44ac-b853-2921483f1950'; | ||
public const USERNAME = 'user#1'; | ||
public const EMAIL = '[email protected]'; | ||
|
||
public function load(ObjectManager $manager): void | ||
{ | ||
$permissions = new UserPermissions(Uuid::fromString('35874dd8-8230-41ca-ab18-1acb3419c177')); | ||
$permissions = new UserPermissions(Uuid::fromString('b62733f6-97dc-4031-b74a-ecb080c09658')); | ||
|
||
$user = new User( | ||
Uuid::fromString(self::ID), | ||
'regular#0', | ||
'[email protected]', | ||
self::ID, | ||
self::USERNAME, | ||
self::EMAIL, | ||
str_repeat('1', 18), | ||
$permissions, | ||
[], | ||
null, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\DataFixtures\User; | ||
|
||
use App\Entity\Permissions\UserPermissions; | ||
use App\Entity\User\User; | ||
use Doctrine\Bundle\FixturesBundle\Fixture; | ||
use Doctrine\Persistence\ObjectManager; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class User2Fixture extends Fixture | ||
{ | ||
public const ID = '43c65dee-8da8-4198-87da-cb58ecc23508'; | ||
public const USERNAME = 'user#2'; | ||
public const EMAIL = '[email protected]'; | ||
|
||
public function load(ObjectManager $manager): void | ||
{ | ||
$permissions = new UserPermissions(Uuid::fromString('97f1c390-46e8-47cd-b60d-e9cca1ae892e')); | ||
|
||
$user = new User( | ||
Uuid::fromString(self::ID), | ||
self::USERNAME, | ||
self::EMAIL, | ||
str_repeat('2', 18), | ||
$permissions, | ||
[], | ||
null, | ||
null | ||
); | ||
|
||
$manager->persist($permissions); | ||
$manager->persist($user); | ||
$manager->flush(); | ||
|
||
$this->addReference(self::ID, $user); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\DataFixtures\User; | ||
|
||
use App\Entity\Permissions\UserPermissions; | ||
use App\Entity\User\User; | ||
use Doctrine\Bundle\FixturesBundle\Fixture; | ||
use Doctrine\Persistence\ObjectManager; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class User3Fixture extends Fixture | ||
{ | ||
public const ID = '7e1a0cae-e0c3-4b1d-9ce7-671505267a87'; | ||
public const USERNAME = 'user#3'; | ||
public const EMAIL = '[email protected]'; | ||
|
||
public function load(ObjectManager $manager): void | ||
{ | ||
$permissions = new UserPermissions(Uuid::fromString('7dcfba43-a09c-46c0-9dbd-701442bd4f83')); | ||
|
||
$user = new User( | ||
Uuid::fromString(self::ID), | ||
self::USERNAME, | ||
self::EMAIL, | ||
str_repeat('3', 18), | ||
$permissions, | ||
[], | ||
null, | ||
null | ||
); | ||
|
||
$manager->persist($permissions); | ||
$manager->persist($user); | ||
$manager->flush(); | ||
|
||
$this->addReference(self::ID, $user); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.