public function testLoadContent() { $repository = $this->getRepositoryMock(); $contentService = $this->getPartlyMockedContentService(array('internalLoadContent')); $content = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\Content'); $versionInfo = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\Values\\Content\\VersionInfo')->setConstructorArgs(array(array('status' => APIVersionInfo::STATUS_PUBLISHED)))->getMockForAbstractClass(); $content->expects($this->once())->method('getVersionInfo')->will($this->returnValue($versionInfo)); $contentId = 123; $contentService->expects($this->once())->method('internalLoadContent')->with($contentId)->will($this->returnValue($content)); $repository->expects($this->once())->method('canUser')->with('content', 'read', $content)->will($this->returnValue(true)); $this->assertSame($content, $contentService->loadContent($contentId)); }