Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 2291-2313 (lines=23) @@
2288
     * @see \eZ\Publish\API\Repository\ContentService::deleteContent()
2289
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2290
     */
2291
    public function testDeleteContent()
2292
    {
2293
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class);
2294
2295
        $repository = $this->getRepository();
2296
2297
        $contentService = $repository->getContentService();
2298
        $locationService = $repository->getLocationService();
2299
2300
        /* BEGIN: Use Case */
2301
        $contentVersion2 = $this->createContentVersion2();
2302
2303
        // Load the locations for this content object
2304
        $locations = $locationService->loadLocations($contentVersion2->contentInfo);
2305
2306
        // This will delete the content, all versions and the associated locations
2307
        $contentService->deleteContent($contentVersion2->contentInfo);
2308
        /* END: Use Case */
2309
2310
        foreach ($locations as $location) {
2311
            $locationService->loadLocation($location->id);
2312
        }
2313
    }
2314
2315
    /**
2316
     * Test for the deleteContent() method.
@@ 2324-2346 (lines=23) @@
2321
     * @see \eZ\Publish\API\Repository\ContentService::deleteContent()
2322
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2323
     */
2324
    public function testDeleteContentWithEmptyBinaryField()
2325
    {
2326
        $this->expectException(\eZ\Publish\API\Repository\Exceptions\NotFoundException::class);
2327
2328
        $repository = $this->getRepository();
2329
2330
        $contentService = $repository->getContentService();
2331
        $locationService = $repository->getLocationService();
2332
2333
        /* BEGIN: Use Case */
2334
        $contentVersion = $this->createContentVersion1EmptyBinaryField();
2335
2336
        // Load the locations for this content object
2337
        $locations = $locationService->loadLocations($contentVersion->contentInfo);
2338
2339
        // This will delete the content, all versions and the associated locations
2340
        $contentService->deleteContent($contentVersion->contentInfo);
2341
        /* END: Use Case */
2342
2343
        foreach ($locations as $location) {
2344
            $locationService->loadLocation($location->id);
2345
        }
2346
    }
2347
2348
    /**
2349
     * Test for the loadContentDrafts() method.