Code Duplication    Length = 11-19 lines in 2 locations

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

@@ 5829-5839 (lines=11) @@
5826
     * @expectedException \eZ\Publish\API\Repository\Exceptions\BadStateException
5827
     * @expectedExceptionMessage Version is not a draft
5828
     */
5829
    public function testDeleteTranslationFromDraftThrowsBadStateExceptionOnPublishedVersion()
5830
    {
5831
        $repository = $this->getRepository();
5832
        $contentService = $repository->getContentService();
5833
5834
        $languageCode = 'eng-US';
5835
        $content = $this->createMultipleLanguageContentVersion2();
5836
        $draft = $contentService->createContentDraft($content->contentInfo);
5837
        $publishedContent = $contentService->publishVersion($draft->versionInfo);
5838
        $contentService->deleteTranslationFromDraft($publishedContent->versionInfo, $languageCode);
5839
    }
5840
5841
    /**
5842
     * Test deleting a Translation from Draft throws UnauthorizedException if user cannot edit Content.

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

@@ 799-817 (lines=19) @@
796
     *
797
     * @return \eZ\Publish\API\Repository\Values\Content\Content
798
     */
799
    public function updateContent($fieldData, $setField = true)
800
    {
801
        $content = $this->testPublishContent();
802
803
        $repository = $this->getRepository();
804
        $contentService = $repository->getContentService();
805
806
        $draft = $contentService->createContentDraft($content->contentInfo);
807
808
        $updateStruct = $contentService->newContentUpdateStruct();
809
        if ($setField) {
810
            $updateStruct->setField(
811
                $this->customFieldIdentifier,
812
                $fieldData
813
            );
814
        }
815
816
        return $contentService->updateContent($draft->versionInfo, $updateStruct);
817
    }
818
819
    /**
820
     * @depends testUpdateField