eZ\Publish\Core\Repository\Tests\Service\Mock\ContentTest::testDeleteContentThrowsUnauthorizedException PHP Method

testDeleteContentThrowsUnauthorizedException() public method

Test for the deleteContent() method.
    public function testDeleteContentThrowsUnauthorizedException()
    {
        $repository = $this->getRepositoryMock();
        $contentService = $this->getPartlyMockedContentService(array('internalLoadContentInfo'));
        $contentInfo = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo');
        $contentInfo->expects($this->any())->method('__get')->with('id')->will($this->returnValue(42));
        $contentService->expects($this->once())->method('internalLoadContentInfo')->with(42)->will($this->returnValue($contentInfo));
        $repository->expects($this->once())->method('canUser')->with('content', 'remove')->will($this->returnValue(false));
        /* @var \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo */
        $contentService->deleteContent($contentInfo);
    }
ContentTest