Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 4970-4988 (lines=19) @@
4967
     *
4968
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
4969
     */
4970
    private function assertDefaultContentStates(ContentInfo $contentInfo)
4971
    {
4972
        $repository = $this->getRepository();
4973
        $objectStateService = $repository->getObjectStateService();
4974
4975
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
4976
4977
        foreach ($objectStateGroups as $objectStateGroup) {
4978
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
4979
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
4980
                // Only check the first object state which is the default one.
4981
                $this->assertEquals(
4982
                    $objectState,
4983
                    $contentState
4984
                );
4985
                break;
4986
            }
4987
        }
4988
    }
4989
4990
    /**
4991
     * Returns the default fixture of fields used in most tests.

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

@@ 1746-1764 (lines=19) @@
1743
     *
1744
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1745
     */
1746
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1747
    {
1748
        $repository = $this->getRepository();
1749
        $objectStateService = $repository->getObjectStateService();
1750
1751
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1752
1753
        foreach ($objectStateGroups as $objectStateGroup) {
1754
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1755
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1756
                // Only check the first object state which is the default one.
1757
                $this->assertEquals(
1758
                    $objectState,
1759
                    $contentState
1760
                );
1761
                break;
1762
            }
1763
        }
1764
    }
1765
1766
    /**
1767
     * Test for the copySubtree() method.