| Total Complexity | 2 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class TeamFixtures extends Fixture implements DependentFixtureInterface |
||
| 12 | { |
||
| 13 | public const TEAM_REFERENCE_RULE = 'team_by_rule'; |
||
| 14 | |||
| 15 | public function load(ObjectManager $em) |
||
| 16 | { |
||
| 17 | $rule = $em->getRepository(Rule::class)->findOneBy(['ruleKey' => 'lrb6']); |
||
| 18 | $team2 = (new Team()) |
||
| 19 | ->setName('Team test by rule') |
||
| 20 | ->setRoster('dark_elf') |
||
| 21 | ->setCoach($this->getReference(CoachFixtures::COACH_USER_REFERENCE)) |
||
| 22 | ->setRule($rule); |
||
| 23 | $em->persist($team2); |
||
| 24 | $this->addReference(self::TEAM_REFERENCE_RULE, $team2); |
||
| 25 | |||
| 26 | $em->flush(); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getDependencies() |
||
| 30 | { |
||
| 31 | return array( |
||
| 32 | CoachFixtures::class, |
||
| 33 | ); |
||
| 36 |