Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 2117-2137 (lines=21) @@
2114
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2115
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2116
     */
2117
    public function testDeleteContent()
2118
    {
2119
        $repository = $this->getRepository();
2120
2121
        $contentService = $repository->getContentService();
2122
        $locationService = $repository->getLocationService();
2123
2124
        /* BEGIN: Use Case */
2125
        $contentVersion2 = $this->createContentVersion2();
2126
2127
        // Load the locations for this content object
2128
        $locations = $locationService->loadLocations($contentVersion2->contentInfo);
2129
2130
        // This will delete the content, all versions and the associated locations
2131
        $contentService->deleteContent($contentVersion2->contentInfo);
2132
        /* END: Use Case */
2133
2134
        foreach ($locations as $location) {
2135
            $locationService->loadLocation($location->id);
2136
        }
2137
    }
2138
2139
    /**
2140
     * Test for the deleteContent() method.
@@ 2149-2169 (lines=21) @@
2146
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2147
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2148
     */
2149
    public function testDeleteContentWithEmptyBinaryField()
2150
    {
2151
        $repository = $this->getRepository();
2152
2153
        $contentService = $repository->getContentService();
2154
        $locationService = $repository->getLocationService();
2155
2156
        /* BEGIN: Use Case */
2157
        $contentVersion = $this->createContentVersion1EmptyBinaryField();
2158
2159
        // Load the locations for this content object
2160
        $locations = $locationService->loadLocations($contentVersion->contentInfo);
2161
2162
        // This will delete the content, all versions and the associated locations
2163
        $contentService->deleteContent($contentVersion->contentInfo);
2164
        /* END: Use Case */
2165
2166
        foreach ($locations as $location) {
2167
            $locationService->loadLocation($location->id);
2168
        }
2169
    }
2170
2171
    /**
2172
     * Test for the loadContentDrafts() method.