Code Duplication    Length = 19-19 lines in 2 locations

eZ/Publish/API/Repository/Tests/LocationServiceTest.php 1 location

@@ 1828-1846 (lines=19) @@
1825
     *
1826
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1827
     */
1828
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1829
    {
1830
        $repository = $this->getRepository();
1831
        $objectStateService = $repository->getObjectStateService();
1832
1833
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1834
1835
        foreach ($objectStateGroups as $objectStateGroup) {
1836
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1837
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1838
                // Only check the first object state which is the default one.
1839
                $this->assertEquals(
1840
                    $objectState,
1841
                    $contentState
1842
                );
1843
                break;
1844
            }
1845
        }
1846
    }
1847
1848
    /**
1849
     * Test for the copySubtree() method.

eZ/Publish/API/Repository/Tests/ContentServiceTest.php 1 location

@@ 6037-6055 (lines=19) @@
6034
     *
6035
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
6036
     */
6037
    private function assertDefaultContentStates(ContentInfo $contentInfo)
6038
    {
6039
        $repository = $this->getRepository();
6040
        $objectStateService = $repository->getObjectStateService();
6041
6042
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
6043
6044
        foreach ($objectStateGroups as $objectStateGroup) {
6045
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
6046
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
6047
                // Only check the first object state which is the default one.
6048
                $this->assertEquals(
6049
                    $objectState,
6050
                    $contentState
6051
                );
6052
                break;
6053
            }
6054
        }
6055
    }
6056
6057
    /**
6058
     * Assert that given Content has no references to a translation specified by the $languageCode.