| @@ 93-111 (lines=19) @@ | ||
| 90 | * @see \eZ\Publish\API\Repository\TrashService::trash() |
|
| 91 | * @depends eZ\Publish\API\Repository\Tests\TrashServiceTest::testTrash |
|
| 92 | */ |
|
| 93 | public function testTrashRemovesLocationFromMainStorage() |
|
| 94 | { |
|
| 95 | $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class); |
|
| 96 | ||
| 97 | $repository = $this->getRepository(); |
|
| 98 | ||
| 99 | $mediaRemoteId = '75c715a51699d2d309a924eca6a95145'; |
|
| 100 | ||
| 101 | /* BEGIN: Use Case */ |
|
| 102 | $this->createTrashItem(); |
|
| 103 | ||
| 104 | // Load the location service |
|
| 105 | $locationService = $repository->getLocationService(); |
|
| 106 | ||
| 107 | // This call will fail with a "NotFoundException", because the media |
|
| 108 | // location was marked as trashed in the main storage |
|
| 109 | $locationService->loadLocationByRemoteId($mediaRemoteId); |
|
| 110 | /* END: Use Case */ |
|
| 111 | } |
|
| 112 | ||
| 113 | /** |
|
| 114 | * Test for the trash() method. |
|
| @@ 755-769 (lines=15) @@ | ||
| 752 | * @see \eZ\Publish\API\Repository\LocationService::loadLocationByRemoteId() |
|
| 753 | * @depends eZ\Publish\API\Repository\Tests\LocationServiceTest::testLoadLocation |
|
| 754 | */ |
|
| 755 | public function testLoadLocationByRemoteIdThrowsNotFoundException() |
|
| 756 | { |
|
| 757 | $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class); |
|
| 758 | ||
| 759 | $repository = $this->getRepository(); |
|
| 760 | ||
| 761 | /* BEGIN: Use Case */ |
|
| 762 | $locationService = $repository->getLocationService(); |
|
| 763 | ||
| 764 | // Throws exception, since Location with remote ID does not exist |
|
| 765 | $location = $locationService->loadLocationByRemoteId( |
|
| 766 | 'not-exists' |
|
| 767 | ); |
|
| 768 | /* END: Use Case */ |
|
| 769 | } |
|
| 770 | ||
| 771 | /** |
|
| 772 | * Test for the loadLocations() method. |
|