Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 1529-1547 (lines=19) @@
1526
     *
1527
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1528
     */
1529
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1530
    {
1531
        $repository = $this->getRepository();
1532
        $objectStateService = $repository->getObjectStateService();
1533
1534
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1535
1536
        foreach ($objectStateGroups as $objectStateGroup) {
1537
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1538
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1539
                // Only check the first object state which is the default one.
1540
                $this->assertEquals(
1541
                    $objectState,
1542
                    $contentState
1543
                );
1544
                break;
1545
            }
1546
        }
1547
    }
1548
1549
    /**
1550
     * Test for the copySubtree() method.

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

@@ 4770-4788 (lines=19) @@
4767
     *
4768
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
4769
     */
4770
    private function assertDefaultContentStates(ContentInfo $contentInfo)
4771
    {
4772
        $repository = $this->getRepository();
4773
        $objectStateService = $repository->getObjectStateService();
4774
4775
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
4776
4777
        foreach ($objectStateGroups as $objectStateGroup) {
4778
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
4779
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
4780
                // Only check the first object state which is the default one.
4781
                $this->assertEquals(
4782
                    $objectState,
4783
                    $contentState
4784
                );
4785
                break;
4786
            }
4787
        }
4788
    }
4789
4790
    /**
4791
     * Returns the default fixture of fields used in most tests.