| @@ 1995-2019 (lines=25) @@ | ||
| 1992 | * @see \eZ\Publish\API\Repository\ContentService::publishVersion() |
|
| 1993 | * @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersionFromContentDraft |
|
| 1994 | */ |
|
| 1995 | public function testPublishVersionFromOldContentDraftArchivesNewerVersionNo() |
|
| 1996 | { |
|
| 1997 | $repository = $this->getRepository(); |
|
| 1998 | ||
| 1999 | $contentService = $repository->getContentService(); |
|
| 2000 | ||
| 2001 | /* BEGIN: Use Case */ |
|
| 2002 | $content = $this->createContentVersion1(); |
|
| 2003 | ||
| 2004 | // Create a new draft with versionNo = 2 |
|
| 2005 | $draftedContentVersion2 = $contentService->createContentDraft($content->contentInfo); |
|
| 2006 | ||
| 2007 | // Create another new draft with versionNo = 3 |
|
| 2008 | $draftedContentVersion3 = $contentService->createContentDraft($content->contentInfo); |
|
| 2009 | ||
| 2010 | // Publish draft with versionNo = 3 |
|
| 2011 | $contentService->publishVersion($draftedContentVersion3->getVersionInfo()); |
|
| 2012 | ||
| 2013 | // Publish the first draft with versionNo = 2 |
|
| 2014 | // currentVersionNo is now 2, versionNo 3 will be archived |
|
| 2015 | $publishedDraft = $contentService->publishVersion($draftedContentVersion2->getVersionInfo()); |
|
| 2016 | /* END: Use Case */ |
|
| 2017 | ||
| 2018 | $this->assertEquals(2, $publishedDraft->contentInfo->currentVersionNo); |
|
| 2019 | } |
|
| 2020 | ||
| 2021 | /** |
|
| 2022 | * Test for the publishVersion() method, and that it creates limited archives. |
|
| @@ 773-790 (lines=18) @@ | ||
| 770 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
|
| 771 | * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
|
| 772 | */ |
|
| 773 | public function testInternalLinkValidatorIgnoresMissingRelationOnNotUpdatedField() |
|
| 774 | { |
|
| 775 | $repository = $this->getRepository(); |
|
| 776 | $contentService = $repository->getContentService(); |
|
| 777 | ||
| 778 | list(, $contentB) = $this->prepareInternalLinkValidatorBrokenLinksTestCase($repository); |
|
| 779 | ||
| 780 | // update field w/o erroneous link to trigger validation |
|
| 781 | $contentUpdateStruct = $contentService->newContentUpdateStruct(); |
|
| 782 | $contentUpdateStruct->setField('data', $this->getValidUpdateFieldData(), 'eng-US'); |
|
| 783 | ||
| 784 | $contentDraftB = $contentService->updateContent( |
|
| 785 | $contentService->createContentDraft($contentB->contentInfo)->versionInfo, |
|
| 786 | $contentUpdateStruct |
|
| 787 | ); |
|
| 788 | ||
| 789 | $contentService->publishVersion($contentDraftB->versionInfo); |
|
| 790 | } |
|
| 791 | ||
| 792 | /** |
|
| 793 | * Test updating Content which contains links to deleted Location fails when updating broken field. |
|