|
@@ 224-239 (lines=16) @@
|
| 221 |
|
* |
| 222 |
|
* @covers \eZ\Publish\API\Repository\TrashService::trash |
| 223 |
|
*/ |
| 224 |
|
public function testTrashReturnsNull() |
| 225 |
|
{ |
| 226 |
|
$contentService = $this->repository->getContentService(); |
| 227 |
|
$locationService = $this->repository->getLocationService(); |
| 228 |
|
$trashService = $this->repository->getTrashService(); |
| 229 |
|
|
| 230 |
|
// Create additional location to trash |
| 231 |
|
$location = $locationService->createLocation( |
| 232 |
|
$contentService->loadContentInfo(42), |
| 233 |
|
new LocationCreateStruct(array('parentLocationId' => 2)) |
| 234 |
|
); |
| 235 |
|
|
| 236 |
|
$trashItem = $trashService->trash($location); |
| 237 |
|
|
| 238 |
|
self::assertNull($trashItem); |
| 239 |
|
} |
| 240 |
|
|
| 241 |
|
/** |
| 242 |
|
* Test recovering a location from trash to original location. |
|
@@ 373-389 (lines=17) @@
|
| 370 |
|
* |
| 371 |
|
* @covers \eZ\Publish\API\Repository\TrashService::deleteTrashItem |
| 372 |
|
*/ |
| 373 |
|
public function testDeleteTrashItem() |
| 374 |
|
{ |
| 375 |
|
$locationService = $this->repository->getLocationService(); |
| 376 |
|
$trashService = $this->repository->getTrashService(); |
| 377 |
|
|
| 378 |
|
$location = $locationService->loadLocation(44); |
| 379 |
|
$trashItem = $trashService->trash($location); |
| 380 |
|
|
| 381 |
|
$trashService->deleteTrashItem($trashItem); |
| 382 |
|
|
| 383 |
|
try { |
| 384 |
|
$trashService->loadTrashItem($trashItem->id); |
| 385 |
|
self::fail('Succeeded loading deleted trash item'); |
| 386 |
|
} catch (NotFoundException $e) { |
| 387 |
|
// Do nothing |
| 388 |
|
} |
| 389 |
|
} |
| 390 |
|
|
| 391 |
|
/** |
| 392 |
|
* Test deleting a non existing trash item. |