Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 1937-1957 (lines=21) @@
1934
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
1935
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
1936
     */
1937
    public function testDeleteContent()
1938
    {
1939
        $repository = $this->getRepository();
1940
1941
        $contentService = $repository->getContentService();
1942
        $locationService = $repository->getLocationService();
1943
1944
        /* BEGIN: Use Case */
1945
        $contentVersion2 = $this->createContentVersion2();
1946
1947
        // Load the locations for this content object
1948
        $locations = $locationService->loadLocations($contentVersion2->contentInfo);
1949
1950
        // This will delete the content, all versions and the associated locations
1951
        $contentService->deleteContent($contentVersion2->contentInfo);
1952
        /* END: Use Case */
1953
1954
        foreach ($locations as $location) {
1955
            $locationService->loadLocation($location->id);
1956
        }
1957
    }
1958
1959
    /**
1960
     * Test for the deleteContent() method.
@@ 1969-1989 (lines=21) @@
1966
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
1967
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
1968
     */
1969
    public function testDeleteContentWithEmptyBinaryField()
1970
    {
1971
        $repository = $this->getRepository();
1972
1973
        $contentService = $repository->getContentService();
1974
        $locationService = $repository->getLocationService();
1975
1976
        /* BEGIN: Use Case */
1977
        $contentVersion = $this->createContentVersion1EmptyBinaryField();
1978
1979
        // Load the locations for this content object
1980
        $locations = $locationService->loadLocations($contentVersion->contentInfo);
1981
1982
        // This will delete the content, all versions and the associated locations
1983
        $contentService->deleteContent($contentVersion->contentInfo);
1984
        /* END: Use Case */
1985
1986
        foreach ($locations as $location) {
1987
            $locationService->loadLocation($location->id);
1988
        }
1989
    }
1990
1991
    /**
1992
     * Test for the loadContentDrafts() method.