|
@@ 138-147 (lines=10) @@
|
| 135 |
|
* @covers \Tfboe\FmLib\Service\LoadingService::keyOfPropertyMap |
| 136 |
|
* @uses \Tfboe\FmLib\Service\LoadingService::__construct |
| 137 |
|
*/ |
| 138 |
|
public function testLoadEntitiesNullProperty() |
| 139 |
|
{ |
| 140 |
|
$service = new LoadingService($this->getEntityManagerMockForQuery([], |
| 141 |
|
'SELECT t1, t2 FROM Tfboe\FmLib\Entity\TournamentInterface t1 LEFT JOIN t1.competitions t2 WHERE t1.id IN(\'t\')' |
| 142 |
|
)); |
| 143 |
|
$tournament = $this->createMock(TournamentInterface::class); |
| 144 |
|
$tournament->method('getEntityId')->willReturn('t'); |
| 145 |
|
$tournament->method('getCompetitions')->willReturn(null); |
| 146 |
|
$service->loadEntities([$tournament], [TournamentInterface::class => [["competitions"]]]); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
/** |
| 150 |
|
* @covers \Tfboe\FmLib\Service\LoadingService::loadEntities |
|
@@ 155-163 (lines=9) @@
|
| 152 |
|
* @covers \Tfboe\FmLib\Service\LoadingService::keyOfPropertyMap |
| 153 |
|
* @uses \Tfboe\FmLib\Service\LoadingService::__construct |
| 154 |
|
*/ |
| 155 |
|
public function testLoadEntitiesSimpleProperty() |
| 156 |
|
{ |
| 157 |
|
$service = new LoadingService($this->getEntityManagerMockForQuery([], |
| 158 |
|
'SELECT t1, t2 FROM Tfboe\FmLib\Entity\CompetitionInterface t1 LEFT JOIN t1.tournament t2 WHERE t1.id IN(\'c\')' |
| 159 |
|
)); |
| 160 |
|
$competition = $this->createMock(CompetitionInterface::class); |
| 161 |
|
$competition->method('getEntityId')->willReturn('c'); |
| 162 |
|
$service->loadEntities([$competition], [CompetitionInterface::class => [["tournament"]]]); |
| 163 |
|
} |
| 164 |
|
//</editor-fold desc="Public Methods"> |
| 165 |
|
} |