Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 4786-4804 (lines=19) @@
4783
     *
4784
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
4785
     */
4786
    private function assertDefaultContentStates(ContentInfo $contentInfo)
4787
    {
4788
        $repository = $this->getRepository();
4789
        $objectStateService = $repository->getObjectStateService();
4790
4791
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
4792
4793
        foreach ($objectStateGroups as $objectStateGroup) {
4794
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
4795
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
4796
                // Only check the first object state which is the default one.
4797
                $this->assertEquals(
4798
                    $objectState,
4799
                    $contentState
4800
                );
4801
                break;
4802
            }
4803
        }
4804
    }
4805
4806
    /**
4807
     * Returns the default fixture of fields used in most tests.

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

@@ 1546-1564 (lines=19) @@
1543
     *
1544
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1545
     */
1546
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1547
    {
1548
        $repository = $this->getRepository();
1549
        $objectStateService = $repository->getObjectStateService();
1550
1551
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1552
1553
        foreach ($objectStateGroups as $objectStateGroup) {
1554
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1555
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1556
                // Only check the first object state which is the default one.
1557
                $this->assertEquals(
1558
                    $objectState,
1559
                    $contentState
1560
                );
1561
                break;
1562
            }
1563
        }
1564
    }
1565
1566
    /**
1567
     * Test for the copySubtree() method.