Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 5800-5818 (lines=19) @@
5797
     *
5798
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
5799
     */
5800
    private function assertDefaultContentStates(ContentInfo $contentInfo)
5801
    {
5802
        $repository = $this->getRepository();
5803
        $objectStateService = $repository->getObjectStateService();
5804
5805
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
5806
5807
        foreach ($objectStateGroups as $objectStateGroup) {
5808
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
5809
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
5810
                // Only check the first object state which is the default one.
5811
                $this->assertEquals(
5812
                    $objectState,
5813
                    $contentState
5814
                );
5815
                break;
5816
            }
5817
        }
5818
    }
5819
5820
    /**
5821
     * Assert that given Content has no references to a translation specified by the $languageCode.

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

@@ 1627-1645 (lines=19) @@
1624
     *
1625
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1626
     */
1627
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1628
    {
1629
        $repository = $this->getRepository();
1630
        $objectStateService = $repository->getObjectStateService();
1631
1632
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1633
1634
        foreach ($objectStateGroups as $objectStateGroup) {
1635
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1636
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1637
                // Only check the first object state which is the default one.
1638
                $this->assertEquals(
1639
                    $objectState,
1640
                    $contentState
1641
                );
1642
                break;
1643
            }
1644
        }
1645
    }
1646
1647
    /**
1648
     * Test for the copySubtree() method.