Code Duplication    Length = 21-21 lines in 2 locations

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

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