@@ 604-618 (lines=15) @@ | ||
601 | * @see \eZ\Publish\API\Repository\LocationService::loadLocation() |
|
602 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testCreateLocation |
|
603 | */ |
|
604 | public function testLoadLocationThrowsNotFoundException() |
|
605 | { |
|
606 | $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class); |
|
607 | ||
608 | $repository = $this->getRepository(); |
|
609 | ||
610 | $nonExistentLocationId = $this->generateId('location', 2342); |
|
611 | /* BEGIN: Use Case */ |
|
612 | $locationService = $repository->getLocationService(); |
|
613 | ||
614 | // Throws exception, if Location with $nonExistentLocationId does not |
|
615 | // exist |
|
616 | $location = $locationService->loadLocation($nonExistentLocationId); |
|
617 | /* END: Use Case */ |
|
618 | } |
|
619 | ||
620 | /** |
|
621 | * Test for the loadLocationList() method. |
|
@@ 733-749 (lines=17) @@ | ||
730 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationByRemoteId() |
|
731 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation |
|
732 | */ |
|
733 | public function testLoadLocationByRemoteId() |
|
734 | { |
|
735 | $repository = $this->getRepository(); |
|
736 | ||
737 | /* BEGIN: Use Case */ |
|
738 | $locationService = $repository->getLocationService(); |
|
739 | ||
740 | $location = $locationService->loadLocationByRemoteId( |
|
741 | '3f6d92f8044aed134f32153517850f5a' |
|
742 | ); |
|
743 | /* END: Use Case */ |
|
744 | ||
745 | $this->assertEquals( |
|
746 | $locationService->loadLocation($this->generateId('location', 5)), |
|
747 | $location |
|
748 | ); |
|
749 | } |
|
750 | ||
751 | /** |
|
752 | * Test for the loadLocationByRemoteId() method. |