Code Duplication    Length = 11-19 lines in 2 locations

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

@@ 5469-5479 (lines=11) @@
5466
     * @expectedException \eZ\Publish\API\Repository\Exceptions\BadStateException
5467
     * @expectedExceptionMessage Version is not a draft
5468
     */
5469
    public function testDeleteTranslationFromDraftThrowsBadStateExceptionOnPublishedVersion()
5470
    {
5471
        $repository = $this->getRepository();
5472
        $contentService = $repository->getContentService();
5473
5474
        $languageCode = 'eng-US';
5475
        $content = $this->createMultipleLanguageContentVersion2();
5476
        $draft = $contentService->createContentDraft($content->contentInfo);
5477
        $publishedContent = $contentService->publishVersion($draft->versionInfo);
5478
        $contentService->deleteTranslationFromDraft($publishedContent->versionInfo, $languageCode);
5479
    }
5480
5481
    /**
5482
     * Test deleting a Translation from Draft throws UnauthorizedException if user cannot edit Content.

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

@@ 734-752 (lines=19) @@
731
     *
732
     * @return \eZ\Publish\API\Repository\Values\Content\Content
733
     */
734
    public function updateContent($fieldData, $setField = true)
735
    {
736
        $content = $this->testPublishContent();
737
738
        $repository = $this->getRepository();
739
        $contentService = $repository->getContentService();
740
741
        $draft = $contentService->createContentDraft($content->contentInfo);
742
743
        $updateStruct = $contentService->newContentUpdateStruct();
744
        if ($setField) {
745
            $updateStruct->setField(
746
                $this->customFieldIdentifier,
747
                $fieldData
748
            );
749
        }
750
751
        return $contentService->updateContent($draft->versionInfo, $updateStruct);
752
    }
753
754
    /**
755
     * @depends testUpdateField