Code Duplication    Length = 21-21 lines in 2 locations

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

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