Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 6031-6049 (lines=19) @@
6028
     *
6029
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
6030
     */
6031
    private function assertDefaultContentStates(ContentInfo $contentInfo)
6032
    {
6033
        $repository = $this->getRepository();
6034
        $objectStateService = $repository->getObjectStateService();
6035
6036
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
6037
6038
        foreach ($objectStateGroups as $objectStateGroup) {
6039
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
6040
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
6041
                // Only check the first object state which is the default one.
6042
                $this->assertEquals(
6043
                    $objectState,
6044
                    $contentState
6045
                );
6046
                break;
6047
            }
6048
        }
6049
    }
6050
6051
    /**
6052
     * Assert that given Content has no references to a translation specified by the $languageCode.

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

@@ 1865-1883 (lines=19) @@
1862
     *
1863
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1864
     */
1865
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1866
    {
1867
        $repository = $this->getRepository();
1868
        $objectStateService = $repository->getObjectStateService();
1869
1870
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1871
1872
        foreach ($objectStateGroups as $objectStateGroup) {
1873
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1874
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1875
                // Only check the first object state which is the default one.
1876
                $this->assertEquals(
1877
                    $objectState,
1878
                    $contentState
1879
                );
1880
                break;
1881
            }
1882
        }
1883
    }
1884
1885
    /**
1886
     * Test for the copySubtree() method.