Code Duplication    Length = 14-14 lines in 4 locations

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

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