Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 1819-1839 (lines=21) @@
1816
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
1817
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
1818
     */
1819
    public function testDeleteContent()
1820
    {
1821
        $repository = $this->getRepository();
1822
1823
        $contentService = $repository->getContentService();
1824
        $locationService = $repository->getLocationService();
1825
1826
        /* BEGIN: Use Case */
1827
        $contentVersion2 = $this->createContentVersion2();
1828
1829
        // Load the locations for this content object
1830
        $locations = $locationService->loadLocations($contentVersion2->contentInfo);
1831
1832
        // This will delete the content, all versions and the associated locations
1833
        $contentService->deleteContent($contentVersion2->contentInfo);
1834
        /* END: Use Case */
1835
1836
        foreach ($locations as $location) {
1837
            $locationService->loadLocation($location->id);
1838
        }
1839
    }
1840
1841
    /**
1842
     * Test for the deleteContent() method.
@@ 1851-1871 (lines=21) @@
1848
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
1849
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
1850
     */
1851
    public function testDeleteContentWithEmptyBinaryField()
1852
    {
1853
        $repository = $this->getRepository();
1854
1855
        $contentService = $repository->getContentService();
1856
        $locationService = $repository->getLocationService();
1857
1858
        /* BEGIN: Use Case */
1859
        $contentVersion = $this->createContentVersion1EmptyBinaryField();
1860
1861
        // Load the locations for this content object
1862
        $locations = $locationService->loadLocations($contentVersion->contentInfo);
1863
1864
        // This will delete the content, all versions and the associated locations
1865
        $contentService->deleteContent($contentVersion->contentInfo);
1866
        /* END: Use Case */
1867
1868
        foreach ($locations as $location) {
1869
            $locationService->loadLocation($location->id);
1870
        }
1871
    }
1872
1873
    /**
1874
     * Test for the loadContentDrafts() method.