Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 5765-5783 (lines=19) @@
5762
     *
5763
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
5764
     */
5765
    private function assertDefaultContentStates(ContentInfo $contentInfo)
5766
    {
5767
        $repository = $this->getRepository();
5768
        $objectStateService = $repository->getObjectStateService();
5769
5770
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
5771
5772
        foreach ($objectStateGroups as $objectStateGroup) {
5773
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
5774
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
5775
                // Only check the first object state which is the default one.
5776
                $this->assertEquals(
5777
                    $objectState,
5778
                    $contentState
5779
                );
5780
                break;
5781
            }
5782
        }
5783
    }
5784
5785
    /**
5786
     * Assert that given Content has no references to a translation specified by the $languageCode.

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.