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

@@ 6130-6148 (lines=19) @@
6127
     *
6128
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
6129
     */
6130
    private function assertDefaultContentStates(ContentInfo $contentInfo)
6131
    {
6132
        $repository = $this->getRepository();
6133
        $objectStateService = $repository->getObjectStateService();
6134
6135
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
6136
6137
        foreach ($objectStateGroups as $objectStateGroup) {
6138
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
6139
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
6140
                // Only check the first object state which is the default one.
6141
                $this->assertEquals(
6142
                    $objectState,
6143
                    $contentState
6144
                );
6145
                break;
6146
            }
6147
        }
6148
    }
6149
6150
    /**
6151
     * Assert that given Content has no references to a translation specified by the $languageCode.