Code Duplication    Length = 21-21 lines in 2 locations

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

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