Code Duplication    Length = 21-21 lines in 2 locations

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

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