Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 2093-2113 (lines=21) @@
2090
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2091
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2092
     */
2093
    public function testDeleteContent()
2094
    {
2095
        $repository = $this->getRepository();
2096
2097
        $contentService = $repository->getContentService();
2098
        $locationService = $repository->getLocationService();
2099
2100
        /* BEGIN: Use Case */
2101
        $contentVersion2 = $this->createContentVersion2();
2102
2103
        // Load the locations for this content object
2104
        $locations = $locationService->loadLocations($contentVersion2->contentInfo);
2105
2106
        // This will delete the content, all versions and the associated locations
2107
        $contentService->deleteContent($contentVersion2->contentInfo);
2108
        /* END: Use Case */
2109
2110
        foreach ($locations as $location) {
2111
            $locationService->loadLocation($location->id);
2112
        }
2113
    }
2114
2115
    /**
2116
     * Test for the deleteContent() method.
@@ 2125-2145 (lines=21) @@
2122
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2123
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
2124
     */
2125
    public function testDeleteContentWithEmptyBinaryField()
2126
    {
2127
        $repository = $this->getRepository();
2128
2129
        $contentService = $repository->getContentService();
2130
        $locationService = $repository->getLocationService();
2131
2132
        /* BEGIN: Use Case */
2133
        $contentVersion = $this->createContentVersion1EmptyBinaryField();
2134
2135
        // Load the locations for this content object
2136
        $locations = $locationService->loadLocations($contentVersion->contentInfo);
2137
2138
        // This will delete the content, all versions and the associated locations
2139
        $contentService->deleteContent($contentVersion->contentInfo);
2140
        /* END: Use Case */
2141
2142
        foreach ($locations as $location) {
2143
            $locationService->loadLocation($location->id);
2144
        }
2145
    }
2146
2147
    /**
2148
     * Test for the loadContentDrafts() method.