Code Duplication    Length = 21-21 lines in 2 locations

eZ/Publish/API/Repository/Tests/ContentServiceTest.php 2 locations

@@ 2273-2293 (lines=21) @@
2270
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2271
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2272
     */
2273
    public function testDeleteContent()
2274
    {
2275
        $repository = $this->getRepository();
2276
2277
        $contentService = $repository->getContentService();
2278
        $locationService = $repository->getLocationService();
2279
2280
        /* BEGIN: Use Case */
2281
        $contentVersion2 = $this->createContentVersion2();
2282
2283
        // Load the locations for this content object
2284
        $locations = $locationService->loadLocations($contentVersion2->contentInfo);
2285
2286
        // This will delete the content, all versions and the associated locations
2287
        $contentService->deleteContent($contentVersion2->contentInfo);
2288
        /* END: Use Case */
2289
2290
        foreach ($locations as $location) {
2291
            $locationService->loadLocation($location->id);
2292
        }
2293
    }
2294
2295
    /**
2296
     * Test for the deleteContent() method.
@@ 2305-2325 (lines=21) @@
2302
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2303
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2304
     */
2305
    public function testDeleteContentWithEmptyBinaryField()
2306
    {
2307
        $repository = $this->getRepository();
2308
2309
        $contentService = $repository->getContentService();
2310
        $locationService = $repository->getLocationService();
2311
2312
        /* BEGIN: Use Case */
2313
        $contentVersion = $this->createContentVersion1EmptyBinaryField();
2314
2315
        // Load the locations for this content object
2316
        $locations = $locationService->loadLocations($contentVersion->contentInfo);
2317
2318
        // This will delete the content, all versions and the associated locations
2319
        $contentService->deleteContent($contentVersion->contentInfo);
2320
        /* END: Use Case */
2321
2322
        foreach ($locations as $location) {
2323
            $locationService->loadLocation($location->id);
2324
        }
2325
    }
2326
2327
    /**
2328
     * Test for the loadContentDrafts() method.