| @@ 103-114 (lines=12) @@ | ||
| 100 | * @covers \Tfboe\FmLib\Entity\Traits\Phase::getChildren |
|
| 101 | * @uses \Tfboe\FmLib\Entity\Traits\Phase::init |
|
| 102 | */ |
|
| 103 | public function testMatchesAndChildren() |
|
| 104 | { |
|
| 105 | $phase = $this->phase(); |
|
| 106 | self::callProtectedMethod($phase, 'init'); |
|
| 107 | $match = $this->createStub(MatchInterface::class, ['getMatchNumber' => 1]); |
|
| 108 | self::assertEquals($phase->getMatches(), $phase->getChildren()); |
|
| 109 | /** @var MatchInterface $match */ |
|
| 110 | $phase->getMatches()->set($match->getMatchNumber(), $match); |
|
| 111 | self::assertEquals(1, $phase->getMatches()->count()); |
|
| 112 | self::assertEquals($match, $phase->getMatches()[1]); |
|
| 113 | self::assertEquals($phase->getMatches(), $phase->getChildren()); |
|
| 114 | } |
|
| 115 | ||
| 116 | /** |
|
| 117 | * @covers \Tfboe\FmLib\Entity\Traits\Phase::getPostQualifications |
|
| @@ 45-56 (lines=12) @@ | ||
| 42 | * @uses \Tfboe\FmLib\Entity\Traits\Tournament::init |
|
| 43 | * @uses \Tfboe\FmLib\Entity\Helpers\TournamentHierarchyEntity::__construct |
|
| 44 | */ |
|
| 45 | public function testCompetitionsAndChildren() |
|
| 46 | { |
|
| 47 | $tournament = $this->tournament(); |
|
| 48 | self::callProtectedMethod($tournament, 'init'); |
|
| 49 | $competition = $this->createStub(CompetitionInterface::class, ['getName' => 'comp name']); |
|
| 50 | self::assertEquals($tournament->getCompetitions(), $tournament->getChildren()); |
|
| 51 | /** @var CompetitionInterface $competition */ |
|
| 52 | $tournament->getCompetitions()->set($competition->getName(), $competition); |
|
| 53 | self::assertEquals(1, $tournament->getCompetitions()->count()); |
|
| 54 | self::assertEquals($competition, $tournament->getCompetitions()[$competition->getName()]); |
|
| 55 | self::assertEquals($tournament->getCompetitions(), $tournament->getChildren()); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * @covers \Tfboe\FmLib\Entity\Traits\Tournament::init |
|