|
@@ 618-631 (lines=14) @@
|
| 615 |
|
* |
| 616 |
|
* @covers \eZ\Publish\API\Repository\LocationService::loadLocationList |
| 617 |
|
*/ |
| 618 |
|
public function testLoadLocationList(): void |
| 619 |
|
{ |
| 620 |
|
$repository = $this->getRepository(); |
| 621 |
|
|
| 622 |
|
// 5 is the ID of an existing location, 442 is a non-existing id |
| 623 |
|
$locationService = $repository->getLocationService(); |
| 624 |
|
$locations = $locationService->loadLocationList([5, 442]); |
| 625 |
|
|
| 626 |
|
self::assertInternalType('iterable', $locations); |
| 627 |
|
self::assertCount(1, $locations); |
| 628 |
|
self::assertEquals([5], array_keys($locations)); |
| 629 |
|
self::assertInstanceOf(Location::class, $locations[5]); |
| 630 |
|
self::assertEquals(5, $locations[5]->id); |
| 631 |
|
} |
| 632 |
|
|
| 633 |
|
/** |
| 634 |
|
* Test for the loadLocationList() method. |
|
@@ 681-694 (lines=14) @@
|
| 678 |
|
* |
| 679 |
|
* @covers \eZ\Publish\API\Repository\LocationService::loadLocationList |
| 680 |
|
*/ |
| 681 |
|
public function testLoadLocationListWithRootLocationId() |
| 682 |
|
{ |
| 683 |
|
$repository = $this->getRepository(); |
| 684 |
|
|
| 685 |
|
// 1 is the ID of an root location |
| 686 |
|
$locationService = $repository->getLocationService(); |
| 687 |
|
$locations = $locationService->loadLocationList([1]); |
| 688 |
|
|
| 689 |
|
self::assertInternalType('iterable', $locations); |
| 690 |
|
self::assertCount(1, $locations); |
| 691 |
|
self::assertEquals([1], array_keys($locations)); |
| 692 |
|
self::assertInstanceOf(Location::class, $locations[1]); |
| 693 |
|
self::assertEquals(1, $locations[1]->id); |
| 694 |
|
} |
| 695 |
|
|
| 696 |
|
/** |
| 697 |
|
* Test for the loadLocationList() method. |