|
@@ 206-222 (lines=17) @@
|
| 203 |
|
* |
| 204 |
|
* @covers \eZ\Publish\API\Repository\TrashService::trash |
| 205 |
|
*/ |
| 206 |
|
public function testTrashReturnsNull() |
| 207 |
|
{ |
| 208 |
|
$repository = $this->getRepository(); |
| 209 |
|
$contentService = $repository->getContentService(); |
| 210 |
|
$locationService = $repository->getLocationService(); |
| 211 |
|
$trashService = $repository->getTrashService(); |
| 212 |
|
|
| 213 |
|
// Create additional location to trash |
| 214 |
|
$location = $locationService->createLocation( |
| 215 |
|
$contentService->loadContentInfo(42), |
| 216 |
|
new LocationCreateStruct(['parentLocationId' => 2]) |
| 217 |
|
); |
| 218 |
|
|
| 219 |
|
$trashItem = $trashService->trash($location); |
| 220 |
|
|
| 221 |
|
self::assertNull($trashItem); |
| 222 |
|
} |
| 223 |
|
|
| 224 |
|
/** |
| 225 |
|
* Test for the loadTrashItem() method. |
|
@@ 602-618 (lines=17) @@
|
| 599 |
|
* @covers \eZ\Publish\API\Repository\TrashService::recover |
| 600 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException |
| 601 |
|
*/ |
| 602 |
|
public function testRecoverToNonExistingLocation() |
| 603 |
|
{ |
| 604 |
|
$repository = $this->getRepository(); |
| 605 |
|
$trashService = $repository->getTrashService(); |
| 606 |
|
$locationService = $repository->getLocationService(); |
| 607 |
|
|
| 608 |
|
$location = $locationService->loadLocation(44); |
| 609 |
|
$trashItem = $trashService->trash($location); |
| 610 |
|
|
| 611 |
|
$newParentLocation = new Location( |
| 612 |
|
array( |
| 613 |
|
'id' => 123456, |
| 614 |
|
'parentLocationId' => 123455, |
| 615 |
|
) |
| 616 |
|
); |
| 617 |
|
$trashService->recover($trashItem, $newParentLocation); |
| 618 |
|
} |
| 619 |
|
|
| 620 |
|
/** |
| 621 |
|
* Test for the findTrashItems() method. |