Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 1736-1754 (lines=19) @@
1733
     *
1734
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1735
     */
1736
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1737
    {
1738
        $repository = $this->getRepository();
1739
        $objectStateService = $repository->getObjectStateService();
1740
1741
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1742
1743
        foreach ($objectStateGroups as $objectStateGroup) {
1744
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1745
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1746
                // Only check the first object state which is the default one.
1747
                $this->assertEquals(
1748
                    $objectState,
1749
                    $contentState
1750
                );
1751
                break;
1752
            }
1753
        }
1754
    }
1755
1756
    /**
1757
     * Test for the copySubtree() method.

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

@@ 5829-5847 (lines=19) @@
5826
     *
5827
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
5828
     */
5829
    private function assertDefaultContentStates(ContentInfo $contentInfo)
5830
    {
5831
        $repository = $this->getRepository();
5832
        $objectStateService = $repository->getObjectStateService();
5833
5834
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
5835
5836
        foreach ($objectStateGroups as $objectStateGroup) {
5837
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
5838
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
5839
                // Only check the first object state which is the default one.
5840
                $this->assertEquals(
5841
                    $objectState,
5842
                    $contentState
5843
                );
5844
                break;
5845
            }
5846
        }
5847
    }
5848
5849
    /**
5850
     * Assert that given Content has no references to a translation specified by the $languageCode.