本文整理汇总了PHP中PHPCR\SessionInterface::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionInterface::expects方法的具体用法?PHP SessionInterface::expects怎么用?PHP SessionInterface::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPCR\SessionInterface
的用法示例。
在下文中一共展示了SessionInterface::expects方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createNode
protected function createNode($id, $username)
{
$repository = $this->getMockBuilder('Jackalope\\Repository')->disableOriginalConstructor()->getMock();
$this->session->expects($this->any())->method('getRepository')->with()->will($this->returnValue($repository));
$nodeData = array("jcr:primaryType" => "rep:root", "jcr:system" => array(), 'username' => $username);
return new Node($this->factory, $nodeData, $id, $this->session, $this->objectManager);
}
示例2: testCommand
public function testCommand()
{
$this->converter->expects($this->once())->method('convert')->with('Document\\MyClass', array('en'), array(), 'none')->will($this->returnValue(false));
$this->mockSession->expects($this->once())->method('save');
$this->commandTester->execute(array('classname' => 'Document\\MyClass', '--locales' => array('en'), '--force' => true));
$this->assertEquals('.' . PHP_EOL . 'done' . PHP_EOL, $this->commandTester->getDisplay());
}
示例3: setUp
public function setUp()
{
$this->factory = $this->getMock('Jackalope\\FactoryInterface');
$this->session = $this->getSessionMock();
$this->session->expects($this->any())->method('getNodes')->will($this->returnValue(array()));
$this->session->expects($this->any())->method('getNodesByIdentifier')->will($this->returnValue(array()));
$this->eventFilter = new EventFilter($this->factory, $this->session);
}
示例4: createNode
protected function createNode($id, $username, $primaryType = 'rep:root')
{
$repository = $this->getMockBuilder('Jackalope\\Repository')->disableOriginalConstructor()->getMock();
$this->session->expects($this->any())->method('getRepository')->with()->will($this->returnValue($repository));
$type = $this->getMockBuilder('Jackalope\\NodeType\\NodeType')->disableOriginalConstructor()->getMock();
$type->expects($this->any())->method('getName')->with()->will($this->returnValue($primaryType));
$ntm = $this->getMockBuilder('Jackalope\\NodeType\\NodeTypeManager')->disableOriginalConstructor()->getMock();
$ntm->expects($this->any())->method('getNodeType')->with()->will($this->returnValue($type));
$workspace = $this->getMockBuilder('Jackalope\\Workspace')->disableOriginalConstructor()->getMock();
$workspace->expects($this->any())->method('getNodeTypeManager')->with()->will($this->returnValue($ntm));
$this->session->expects($this->any())->method('getWorkspace')->with()->will($this->returnValue($workspace));
$this->session->expects($this->any())->method('nodeExists')->with($id)->will($this->returnValue(true));
$nodeData = array("jcr:primaryType" => $primaryType, "jcr:system" => array(), 'username' => $username);
$node = new Node($this->factory, $nodeData, $id, $this->session, $this->objectManager);
$this->session->expects($this->any())->method('getNode')->with($id)->will($this->returnValue($node));
return $node;
}
示例5: setUp
public function setUp()
{
$this->session = $this->getMock('PHPCR\\SessionInterface');
$this->workspace = $this->getMock('PHPCR\\WorkspaceInterface');
$this->repository = $this->getMock('PHPCR\\RepositoryInterface');
$this->queryManager = $this->getMock('PHPCR\\Query\\QueryManagerInterface');
$this->row1 = $this->getMock('PHPCR\\Tests\\Stubs\\MockRow');
$this->node1 = $this->getMock('PHPCR\\Tests\\Stubs\\MockNode');
$this->dumperHelper = $this->getMockBuilder('PHPCR\\Util\\Console\\Helper\\PhpcrConsoleDumperHelper')->disableOriginalConstructor()->getMock();
$this->helperSet = new HelperSet(array('phpcr' => new PhpcrHelper($this->session), 'phpcr_console_dumper' => $this->dumperHelper));
$this->session->expects($this->any())->method('getWorkspace')->will($this->returnValue($this->workspace));
$this->workspace->expects($this->any())->method('getName')->will($this->returnValue('test'));
$this->workspace->expects($this->any())->method('getQueryManager')->will($this->returnValue($this->queryManager));
$this->queryManager->expects($this->any())->method('getSupportedQueryLanguages')->will($this->returnValue(array('JCR-SQL2')));
$this->application = new Application();
$this->application->setHelperSet($this->helperSet);
}