eZ\Publish\Core\MVC\Symfony\Controller\Tests\Controller\Content\PreviewControllerTest::testPreviewCanUserFail PHP Method

testPreviewCanUserFail() public method

    public function testPreviewCanUserFail()
    {
        $controller = $this->getPreviewController();
        $contentId = 123;
        $lang = 'eng-GB';
        $versionNo = 3;
        $content = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\Content');
        $contentInfo = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo')->setConstructorArgs(array(array('id' => $contentId)))->getMockForAbstractClass();
        $this->locationProvider->expects($this->once())->method('loadMainLocation')->with($contentId)->will($this->returnValue($this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\Location')));
        $this->contentService->expects($this->once())->method('loadContent')->with($contentId, array($lang), $versionNo)->will($this->returnValue($content));
        $this->authorizationChecker->expects($this->once())->method('isGranted')->with($this->equalTo(new AuthorizationAttribute('content', 'versionread', array('valueObject' => $content))))->will($this->returnValue(false));
        $controller->previewContentAction(new Request(), $contentId, $versionNo, $lang, 'test');
    }