Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 5991-6009 (lines=19) @@
5988
     *
5989
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
5990
     */
5991
    private function assertDefaultContentStates(ContentInfo $contentInfo)
5992
    {
5993
        $repository = $this->getRepository();
5994
        $objectStateService = $repository->getObjectStateService();
5995
5996
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
5997
5998
        foreach ($objectStateGroups as $objectStateGroup) {
5999
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
6000
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
6001
                // Only check the first object state which is the default one.
6002
                $this->assertEquals(
6003
                    $objectState,
6004
                    $contentState
6005
                );
6006
                break;
6007
            }
6008
        }
6009
    }
6010
6011
    /**
6012
     * Assert that given Content has no references to a translation specified by the $languageCode.

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.