Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 1890-1910 (lines=21) @@
1887
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
1888
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
1889
     */
1890
    public function testDeleteContent()
1891
    {
1892
        $repository = $this->getRepository();
1893
1894
        $contentService = $repository->getContentService();
1895
        $locationService = $repository->getLocationService();
1896
1897
        /* BEGIN: Use Case */
1898
        $contentVersion2 = $this->createContentVersion2();
1899
1900
        // Load the locations for this content object
1901
        $locations = $locationService->loadLocations($contentVersion2->contentInfo);
1902
1903
        // This will delete the content, all versions and the associated locations
1904
        $contentService->deleteContent($contentVersion2->contentInfo);
1905
        /* END: Use Case */
1906
1907
        foreach ($locations as $location) {
1908
            $locationService->loadLocation($location->id);
1909
        }
1910
    }
1911
1912
    /**
1913
     * Test for the deleteContent() method.
@@ 1922-1942 (lines=21) @@
1919
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
1920
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
1921
     */
1922
    public function testDeleteContentWithEmptyBinaryField()
1923
    {
1924
        $repository = $this->getRepository();
1925
1926
        $contentService = $repository->getContentService();
1927
        $locationService = $repository->getLocationService();
1928
1929
        /* BEGIN: Use Case */
1930
        $contentVersion = $this->createContentVersion1EmptyBinaryField();
1931
1932
        // Load the locations for this content object
1933
        $locations = $locationService->loadLocations($contentVersion->contentInfo);
1934
1935
        // This will delete the content, all versions and the associated locations
1936
        $contentService->deleteContent($contentVersion->contentInfo);
1937
        /* END: Use Case */
1938
1939
        foreach ($locations as $location) {
1940
            $locationService->loadLocation($location->id);
1941
        }
1942
    }
1943
1944
    /**
1945
     * Test for the loadContentDrafts() method.