Code Duplication    Length = 14-15 lines in 2 locations

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

@@ 139-153 (lines=15) @@
136
     *
137
     * @return \eZ\Publish\API\Repository\Values\Content\Content
138
     */
139
    protected function createContentDraftVersion2()
140
    {
141
        $repository = $this->getRepository();
142
143
        $contentService = $repository->getContentService();
144
145
        /* BEGIN: Inline */
146
        $content = $this->createContentVersion1();
147
148
        // Create a new draft from the published content
149
        $draftVersion2 = $contentService->createContentDraft($content->contentInfo);
150
        /* END: Inline */
151
152
        return $draftVersion2;
153
    }
154
155
    /**
156
     * Creates an updated content draft named <b>$draftVersion2</b> from

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

@@ 2717-2730 (lines=14) @@
2714
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
2715
     * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testLoadContentByContentInfoWithVersionNumberParameter
2716
     */
2717
    public function testLoadContentByContentInfoThrowsNotFoundExceptionWithVersionNumberParameter()
2718
    {
2719
        $repository = $this->getRepository();
2720
2721
        $contentService = $repository->getContentService();
2722
2723
        /* BEGIN: Use Case */
2724
        $content = $this->createContentVersion1();
2725
2726
        // This call will fail with a "NotFoundException", because no content
2727
        // with versionNo = 2 exists.
2728
        $contentService->loadContentByContentInfo($content->contentInfo, null, 2);
2729
        /* END: Use Case */
2730
    }
2731
2732
    /**
2733
     * Test for the loadContent() method.