|
@@ 452-462 (lines=11) @@
|
| 449 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::loadContent |
| 450 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
| 451 |
|
*/ |
| 452 |
|
public function testLoadContentWithVersionThrowsUnauthorizedException() |
| 453 |
|
{ |
| 454 |
|
list($draft) = $this->createTestContent(); |
| 455 |
|
$this->repository->setCurrentUser($this->getStubbedUser(10)); |
| 456 |
|
|
| 457 |
|
$this->repository->getContentService()->loadContent( |
| 458 |
|
$draft->id, |
| 459 |
|
null, |
| 460 |
|
$draft->versionInfo->versionNo |
| 461 |
|
); |
| 462 |
|
} |
| 463 |
|
|
| 464 |
|
/** |
| 465 |
|
* Test for the loadContent() method. |
|
@@ 1604-1612 (lines=9) @@
|
| 1601 |
|
* @covers \eZ\Publish\Core\Repository\ContentService::publishVersion |
| 1602 |
|
* @expectedException \eZ\Publish\API\Repository\Exceptions\UnauthorizedException |
| 1603 |
|
*/ |
| 1604 |
|
public function testPublishVersionThrowsUnauthorizedException() |
| 1605 |
|
{ |
| 1606 |
|
list($draftContent, $contentType) = $this->createTestContent(); |
| 1607 |
|
|
| 1608 |
|
// Set anonymous as current user |
| 1609 |
|
$this->repository->setCurrentUser($this->getStubbedUser(10)); |
| 1610 |
|
|
| 1611 |
|
$this->repository->getContentService()->publishVersion($draftContent->versionInfo); |
| 1612 |
|
} |
| 1613 |
|
|
| 1614 |
|
/** |
| 1615 |
|
* Test for the createContentDraft() method. |