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