Code Duplication    Length = 14-14 lines in 4 locations

eZ/Publish/API/Repository/Tests/ContentServiceTest.php 4 locations

@@ 1319-1332 (lines=14) @@
1316
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContent
1317
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testCreateContentDraft
1318
     */
1319
    public function testCreateContentDraftLoadContentStillLoadsPublishedVersion()
1320
    {
1321
        /* BEGIN: Use Case */
1322
        $content = $this->createContentVersion1();
1323
1324
        // Now we create a new draft from the published content
1325
        $this->contentService->createContentDraft($content->contentInfo);
1326
1327
        // This call will still load the published content version
1328
        $contentPublished = $this->contentService->loadContent($content->id);
1329
        /* END: Use Case */
1330
1331
        $this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo);
1332
    }
1333
1334
    /**
1335
     * Test for the createContentDraft() method.
@@ 1341-1354 (lines=14) @@
1338
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByRemoteId
1339
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testCreateContentDraft
1340
     */
1341
    public function testCreateContentDraftLoadContentByRemoteIdStillLoadsPublishedVersion()
1342
    {
1343
        /* BEGIN: Use Case */
1344
        $content = $this->createContentVersion1();
1345
1346
        // Now we create a new draft from the published content
1347
        $this->contentService->createContentDraft($content->contentInfo);
1348
1349
        // This call will still load the published content version
1350
        $contentPublished = $this->contentService->loadContentByRemoteId('abcdef0123456789abcdef0123456789');
1351
        /* END: Use Case */
1352
1353
        $this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo);
1354
    }
1355
1356
    /**
1357
     * Test for the createContentDraft() method.
@@ 1363-1376 (lines=14) @@
1360
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfo
1361
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testCreateContentDraft
1362
     */
1363
    public function testCreateContentDraftLoadContentByContentInfoStillLoadsPublishedVersion()
1364
    {
1365
        /* BEGIN: Use Case */
1366
        $content = $this->createContentVersion1();
1367
1368
        // Now we create a new draft from the published content
1369
        $this->contentService->createContentDraft($content->contentInfo);
1370
1371
        // This call will still load the published content version
1372
        $contentPublished = $this->contentService->loadContentByContentInfo($content->contentInfo);
1373
        /* END: Use Case */
1374
1375
        $this->assertEquals(1, $contentPublished->getVersionInfo()->versionNo);
1376
    }
1377
1378
    /**
1379
     * Test for the newContentUpdateStruct() method.
@@ 1728-1741 (lines=14) @@
1725
     * @see \eZ\Publish\API\Repository\ContentService::createContentDraft($contentInfo, $versionInfo)
1726
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testUpdateContent
1727
     */
1728
    public function testCreateContentDraftWithSecondParameter()
1729
    {
1730
        /* BEGIN: Use Case */
1731
        $contentVersion2 = $this->createContentVersion2();
1732
1733
        // Now we create a new draft from the initial version
1734
        $draftedContentReloaded = $this->contentService->createContentDraft(
1735
            $contentVersion2->contentInfo,
1736
            $contentVersion2->getVersionInfo()
1737
        );
1738
        /* END: Use Case */
1739
1740
        $this->assertEquals(3, $draftedContentReloaded->getVersionInfo()->versionNo);
1741
    }
1742
1743
    /**
1744
     * Test for the createContentDraft() method with third parameter.