Code Duplication    Length = 21-21 lines in 2 locations

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

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