|
@@ 563-576 (lines=14) @@
|
| 560 |
|
* |
| 561 |
|
* @covers \eZ\Publish\API\Repository\LocationService::loadLocationList |
| 562 |
|
*/ |
| 563 |
|
public function testLoadLocationList(): void |
| 564 |
|
{ |
| 565 |
|
$repository = $this->getRepository(); |
| 566 |
|
|
| 567 |
|
// 5 is the ID of an existing location, 442 is a non-existing id |
| 568 |
|
$locationService = $repository->getLocationService(); |
| 569 |
|
$locations = $locationService->loadLocationList([5, 442]); |
| 570 |
|
|
| 571 |
|
self::assertIsIterable($locations); |
| 572 |
|
self::assertCount(1, $locations); |
| 573 |
|
self::assertEquals([5], array_keys($locations)); |
| 574 |
|
self::assertInstanceOf(Location::class, $locations[5]); |
| 575 |
|
self::assertEquals(5, $locations[5]->id); |
| 576 |
|
} |
| 577 |
|
|
| 578 |
|
/** |
| 579 |
|
* Test for the loadLocationList() method. |
|
@@ 626-639 (lines=14) @@
|
| 623 |
|
* |
| 624 |
|
* @covers \eZ\Publish\API\Repository\LocationService::loadLocationList |
| 625 |
|
*/ |
| 626 |
|
public function testLoadLocationListWithRootLocationId() |
| 627 |
|
{ |
| 628 |
|
$repository = $this->getRepository(); |
| 629 |
|
|
| 630 |
|
// 1 is the ID of an root location |
| 631 |
|
$locationService = $repository->getLocationService(); |
| 632 |
|
$locations = $locationService->loadLocationList([1]); |
| 633 |
|
|
| 634 |
|
self::assertIsIterable($locations); |
| 635 |
|
self::assertCount(1, $locations); |
| 636 |
|
self::assertEquals([1], array_keys($locations)); |
| 637 |
|
self::assertInstanceOf(Location::class, $locations[1]); |
| 638 |
|
self::assertEquals(1, $locations[1]->id); |
| 639 |
|
} |
| 640 |
|
|
| 641 |
|
/** |
| 642 |
|
* Test for the loadLocationByRemoteId() method. |