Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 5973-5991 (lines=19) @@
5970
     *
5971
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
5972
     */
5973
    private function assertDefaultContentStates(ContentInfo $contentInfo)
5974
    {
5975
        $repository = $this->getRepository();
5976
        $objectStateService = $repository->getObjectStateService();
5977
5978
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
5979
5980
        foreach ($objectStateGroups as $objectStateGroup) {
5981
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
5982
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
5983
                // Only check the first object state which is the default one.
5984
                $this->assertEquals(
5985
                    $objectState,
5986
                    $contentState
5987
                );
5988
                break;
5989
            }
5990
        }
5991
    }
5992
5993
    /**
5994
     * Assert that given Content has no references to a translation specified by the $languageCode.

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

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