Code Duplication    Length = 18-25 lines in 2 locations

eZ/Publish/API/Repository/Tests/FieldType/RichTextIntegrationTest.php 1 location

@@ 686-703 (lines=18) @@
683
     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
684
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
685
     */
686
    public function testInternalLinkValidatorIgnoresMissingRelationOnNotUpdatedField()
687
    {
688
        $repository = $this->getRepository();
689
        $contentService = $repository->getContentService();
690
691
        list(, $contentB) = $this->prepareInternalLinkValidatorBrokenLinksTestCase($repository);
692
693
        // update field w/o erroneous link to trigger validation
694
        $contentUpdateStruct = $contentService->newContentUpdateStruct();
695
        $contentUpdateStruct->setField('data', $this->getValidUpdateFieldData(), 'eng-US');
696
697
        $contentDraftB = $contentService->updateContent(
698
            $contentService->createContentDraft($contentB->contentInfo)->versionInfo,
699
            $contentUpdateStruct
700
        );
701
702
        $contentService->publishVersion($contentDraftB->versionInfo);
703
    }
704
705
    /**
706
     * Test updating Content which contains links to deleted Location fails when updating broken field.

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

@@ 1902-1926 (lines=25) @@
1899
     * @see \eZ\Publish\API\Repository\ContentService::publishVersion()
1900
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft
1901
     */
1902
    public function testPublishVersionFromOldContentDraftArchivesNewerVersionNo()
1903
    {
1904
        $repository = $this->getRepository();
1905
1906
        $contentService = $repository->getContentService();
1907
1908
        /* BEGIN: Use Case */
1909
        $content = $this->createContentVersion1();
1910
1911
        // Create a new draft with versionNo = 2
1912
        $draftedContentVersion2 = $contentService->createContentDraft($content->contentInfo);
1913
1914
        // Create another new draft with versionNo = 3
1915
        $draftedContentVersion3 = $contentService->createContentDraft($content->contentInfo);
1916
1917
        // Publish draft with versionNo = 3
1918
        $contentService->publishVersion($draftedContentVersion3->getVersionInfo());
1919
1920
        // Publish the first draft with versionNo = 2
1921
        // currentVersionNo is now 2, versionNo 3 will be archived
1922
        $publishedDraft = $contentService->publishVersion($draftedContentVersion2->getVersionInfo());
1923
        /* END: Use Case */
1924
1925
        $this->assertEquals(2, $publishedDraft->contentInfo->currentVersionNo);
1926
    }
1927
1928
    /**
1929
     * Test for the publishVersion() method, and that it creates limited archives.