Code Duplication    Length = 21-21 lines in 2 locations

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

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