Code Duplication    Length = 16-17 lines in 2 locations

eZ/Publish/Core/Repository/Tests/Service/Integration/TrashBase.php 2 locations

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