|
@@ 558-571 (lines=14) @@
|
| 555 |
|
* |
| 556 |
|
* @covers \eZ\Publish\API\Repository\LocationService::loadLocationList |
| 557 |
|
*/ |
| 558 |
|
public function testLoadLocationList(): void |
| 559 |
|
{ |
| 560 |
|
$repository = $this->getRepository(); |
| 561 |
|
|
| 562 |
|
// 5 is the ID of an existing location, 442 is a non-existing id |
| 563 |
|
$locationService = $repository->getLocationService(); |
| 564 |
|
$locations = $locationService->loadLocationList([5, 442]); |
| 565 |
|
|
| 566 |
|
self::assertInternalType('iterable', $locations); |
| 567 |
|
self::assertCount(1, $locations); |
| 568 |
|
self::assertEquals([5], array_keys($locations)); |
| 569 |
|
self::assertInstanceOf(Location::class, $locations[5]); |
| 570 |
|
self::assertEquals(5, $locations[5]->id); |
| 571 |
|
} |
| 572 |
|
|
| 573 |
|
/** |
| 574 |
|
* Test for the loadLocationList() method. |
|
@@ 621-634 (lines=14) @@
|
| 618 |
|
* |
| 619 |
|
* @covers \eZ\Publish\API\Repository\LocationService::loadLocationList |
| 620 |
|
*/ |
| 621 |
|
public function testLoadLocationListWithRootLocationId() |
| 622 |
|
{ |
| 623 |
|
$repository = $this->getRepository(); |
| 624 |
|
|
| 625 |
|
// 1 is the ID of an root location |
| 626 |
|
$locationService = $repository->getLocationService(); |
| 627 |
|
$locations = $locationService->loadLocationList([1]); |
| 628 |
|
|
| 629 |
|
self::assertInternalType('iterable', $locations); |
| 630 |
|
self::assertCount(1, $locations); |
| 631 |
|
self::assertEquals([1], array_keys($locations)); |
| 632 |
|
self::assertInstanceOf(Location::class, $locations[1]); |
| 633 |
|
self::assertEquals(1, $locations[1]->id); |
| 634 |
|
} |
| 635 |
|
|
| 636 |
|
/** |
| 637 |
|
* Test for the loadLocationByRemoteId() method. |