Code Duplication    Length = 21-21 lines in 2 locations

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

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