public testCopyContentThrowsUnauthorizedException ( ) |
public function testCopyContentThrowsUnauthorizedException()
{
$repository = $this->getRepositoryMock();
$contentService = $this->getPartlyMockedContentService(array('internalLoadContentInfo'));
$contentInfo = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo');
$locationCreateStruct = new LocationCreateStruct();
$contentInfo->expects($this->any())->method('__get')->with('sectionId')->will($this->returnValue(42));
$repository->expects($this->once())->method('canUser')->with('content', 'create', $contentInfo, $locationCreateStruct)->will($this->returnValue(false));
/* @var \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo */
$contentService->copyContent($contentInfo, $locationCreateStruct);
}