Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 1928-1946 (lines=19) @@
1925
     *
1926
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
1927
     */
1928
    private function assertDefaultContentStates(ContentInfo $contentInfo)
1929
    {
1930
        $repository = $this->getRepository();
1931
        $objectStateService = $repository->getObjectStateService();
1932
1933
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
1934
1935
        foreach ($objectStateGroups as $objectStateGroup) {
1936
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
1937
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
1938
                // Only check the first object state which is the default one.
1939
                $this->assertEquals(
1940
                    $objectState,
1941
                    $contentState
1942
                );
1943
                break;
1944
            }
1945
        }
1946
    }
1947
1948
    /**
1949
     * Test for the copySubtree() method.

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

@@ 6069-6087 (lines=19) @@
6066
     *
6067
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
6068
     */
6069
    private function assertDefaultContentStates(ContentInfo $contentInfo)
6070
    {
6071
        $repository = $this->getRepository();
6072
        $objectStateService = $repository->getObjectStateService();
6073
6074
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
6075
6076
        foreach ($objectStateGroups as $objectStateGroup) {
6077
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
6078
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
6079
                // Only check the first object state which is the default one.
6080
                $this->assertEquals(
6081
                    $objectState,
6082
                    $contentState
6083
                );
6084
                break;
6085
            }
6086
        }
6087
    }
6088
6089
    /**
6090
     * Assert that given Content has no references to a translation specified by the $languageCode.