Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 1568-1586 (lines=19) @@
1565
     *
1566
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1567
     */
1568
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1569
    {
1570
        $repository = $this->getRepository();
1571
        $objectStateService = $repository->getObjectStateService();
1572
1573
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1574
1575
        foreach ($objectStateGroups as $objectStateGroup) {
1576
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1577
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1578
                // Only check the first object state which is the default one.
1579
                $this->assertEquals(
1580
                    $objectState,
1581
                    $contentState
1582
                );
1583
                break;
1584
            }
1585
        }
1586
    }
1587
1588
    /**
1589
     * Test for the copySubtree() method.

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

@@ 5557-5575 (lines=19) @@
5554
     *
5555
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
5556
     */
5557
    private function assertDefaultContentStates(ContentInfo $contentInfo)
5558
    {
5559
        $repository = $this->getRepository();
5560
        $objectStateService = $repository->getObjectStateService();
5561
5562
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
5563
5564
        foreach ($objectStateGroups as $objectStateGroup) {
5565
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
5566
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
5567
                // Only check the first object state which is the default one.
5568
                $this->assertEquals(
5569
                    $objectState,
5570
                    $contentState
5571
                );
5572
                break;
5573
            }
5574
        }
5575
    }
5576
5577
    /**
5578
     * Assert that given Content has no references to a translation specified by the $languageCode.