Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 1664-1682 (lines=19) @@
1661
     *
1662
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1663
     */
1664
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1665
    {
1666
        $repository = $this->getRepository();
1667
        $objectStateService = $repository->getObjectStateService();
1668
1669
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1670
1671
        foreach ($objectStateGroups as $objectStateGroup) {
1672
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1673
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1674
                // Only check the first object state which is the default one.
1675
                $this->assertEquals(
1676
                    $objectState,
1677
                    $contentState
1678
                );
1679
                break;
1680
            }
1681
        }
1682
    }
1683
1684
    /**
1685
     * Test for the copySubtree() method.

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

@@ 5884-5902 (lines=19) @@
5881
     *
5882
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
5883
     */
5884
    private function assertDefaultContentStates(ContentInfo $contentInfo)
5885
    {
5886
        $repository = $this->getRepository();
5887
        $objectStateService = $repository->getObjectStateService();
5888
5889
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
5890
5891
        foreach ($objectStateGroups as $objectStateGroup) {
5892
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
5893
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
5894
                // Only check the first object state which is the default one.
5895
                $this->assertEquals(
5896
                    $objectState,
5897
                    $contentState
5898
                );
5899
                break;
5900
            }
5901
        }
5902
    }
5903
5904
    /**
5905
     * Assert that given Content has no references to a translation specified by the $languageCode.