|
@@ 1170-1190 (lines=21) @@
|
| 1167 |
|
* @depends eZ\Publish\API\Repository\Tests\ContentServiceTest::testPublishVersion |
| 1168 |
|
* @group user |
| 1169 |
|
*/ |
| 1170 |
|
public function testCreateContentDraftAndLoadAccess() |
| 1171 |
|
{ |
| 1172 |
|
$repository = $this->getRepository(); |
| 1173 |
|
|
| 1174 |
|
/* BEGIN: Use Case */ |
| 1175 |
|
$user = $this->createUserVersion1(); |
| 1176 |
|
|
| 1177 |
|
// Set new editor as user |
| 1178 |
|
$repository->setCurrentUser($user); |
| 1179 |
|
|
| 1180 |
|
// Create draft |
| 1181 |
|
$draft = $this->createContentDraftVersion1(2, 'folder'); |
| 1182 |
|
|
| 1183 |
|
// Try to load the draft |
| 1184 |
|
$contentService = $repository->getContentService(); |
| 1185 |
|
$loadedDraft = $contentService->loadContent($draft->id); |
| 1186 |
|
|
| 1187 |
|
/* END: Use Case */ |
| 1188 |
|
|
| 1189 |
|
$this->assertEquals($draft->id, $loadedDraft->id); |
| 1190 |
|
} |
| 1191 |
|
|
| 1192 |
|
/** |
| 1193 |
|
* Test for the createContentDraft() method. |
|
@@ 1730-1749 (lines=20) @@
|
| 1727 |
|
* |
| 1728 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::createContentDraft |
| 1729 |
|
*/ |
| 1730 |
|
public function testCreateContentDraftWithThirdParameter() |
| 1731 |
|
{ |
| 1732 |
|
$repository = $this->getRepository(); |
| 1733 |
|
|
| 1734 |
|
$contentService = $repository->getContentService(); |
| 1735 |
|
|
| 1736 |
|
$content = $contentService->loadContent(4); |
| 1737 |
|
$user = $this->createUserVersion1(); |
| 1738 |
|
|
| 1739 |
|
$draftContent = $contentService->createContentDraft( |
| 1740 |
|
$content->contentInfo, |
| 1741 |
|
$content->getVersionInfo(), |
| 1742 |
|
$user |
| 1743 |
|
); |
| 1744 |
|
|
| 1745 |
|
$this->assertInstanceOf( |
| 1746 |
|
Content::class, |
| 1747 |
|
$draftContent |
| 1748 |
|
); |
| 1749 |
|
} |
| 1750 |
|
|
| 1751 |
|
/** |
| 1752 |
|
* Test for the publishVersion() method. |