Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 2176-2196 (lines=21) @@
2173
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2174
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2175
     */
2176
    public function testDeleteContent()
2177
    {
2178
        $repository = $this->getRepository();
2179
2180
        $contentService = $repository->getContentService();
2181
        $locationService = $repository->getLocationService();
2182
2183
        /* BEGIN: Use Case */
2184
        $contentVersion2 = $this->createContentVersion2();
2185
2186
        // Load the locations for this content object
2187
        $locations = $locationService->loadLocations($contentVersion2->contentInfo);
2188
2189
        // This will delete the content, all versions and the associated locations
2190
        $contentService->deleteContent($contentVersion2->contentInfo);
2191
        /* END: Use Case */
2192
2193
        foreach ($locations as $location) {
2194
            $locationService->loadLocation($location->id);
2195
        }
2196
    }
2197
2198
    /**
2199
     * Test for the deleteContent() method.
@@ 2208-2228 (lines=21) @@
2205
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2206
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2207
     */
2208
    public function testDeleteContentWithEmptyBinaryField()
2209
    {
2210
        $repository = $this->getRepository();
2211
2212
        $contentService = $repository->getContentService();
2213
        $locationService = $repository->getLocationService();
2214
2215
        /* BEGIN: Use Case */
2216
        $contentVersion = $this->createContentVersion1EmptyBinaryField();
2217
2218
        // Load the locations for this content object
2219
        $locations = $locationService->loadLocations($contentVersion->contentInfo);
2220
2221
        // This will delete the content, all versions and the associated locations
2222
        $contentService->deleteContent($contentVersion->contentInfo);
2223
        /* END: Use Case */
2224
2225
        foreach ($locations as $location) {
2226
            $locationService->loadLocation($location->id);
2227
        }
2228
    }
2229
2230
    /**
2231
     * Test for the loadContentDrafts() method.