Code Duplication    Length = 21-21 lines in 2 locations

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

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