Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 6190-6208 (lines=19) @@
6187
     *
6188
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
6189
     */
6190
    private function assertDefaultContentStates(ContentInfo $contentInfo)
6191
    {
6192
        $repository = $this->getRepository();
6193
        $objectStateService = $repository->getObjectStateService();
6194
6195
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
6196
6197
        foreach ($objectStateGroups as $objectStateGroup) {
6198
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
6199
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
6200
                // Only check the first object state which is the default one.
6201
                $this->assertEquals(
6202
                    $objectState,
6203
                    $contentState
6204
                );
6205
                break;
6206
            }
6207
        }
6208
    }
6209
6210
    /**
6211
     * Assert that given Content has no references to a translation specified by the $languageCode.

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

@@ 2173-2191 (lines=19) @@
2170
     *
2171
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo
2172
     */
2173
    private function assertDefaultContentStates(ContentInfo $contentInfo)
2174
    {
2175
        $repository = $this->getRepository();
2176
        $objectStateService = $repository->getObjectStateService();
2177
2178
        $objectStateGroups = $objectStateService->loadObjectStateGroups();
2179
2180
        foreach ($objectStateGroups as $objectStateGroup) {
2181
            $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup);
2182
            foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) {
2183
                // Only check the first object state which is the default one.
2184
                $this->assertEquals(
2185
                    $objectState,
2186
                    $contentState
2187
                );
2188
                break;
2189
            }
2190
        }
2191
    }
2192
2193
    /**
2194
     * Test for the copySubtree() method.