当前位置: 首页>>代码示例>>PHP>>正文


PHP SessionInterface::expects方法代码示例

本文整理汇总了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);
 }
开发者ID:nikophil,项目名称:cmf-tests,代码行数:7,代码来源:UnitOfWorkTest.php

示例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());
 }
开发者ID:doctrine,项目名称:phpcr-odm,代码行数:7,代码来源:DocumentConvertTranslationCommandTest.php

示例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);
 }
开发者ID:frogriotcom,项目名称:jackalope,代码行数:8,代码来源:EventFilterTestCase.php

示例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;
 }
开发者ID:vudaltsov,项目名称:phpcr-odm,代码行数:17,代码来源:UnitOfWorkTest.php

示例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);
 }
开发者ID:nikophil,项目名称:cmf-tests,代码行数:17,代码来源:BaseCommandTest.php


注:本文中的PHPCR\SessionInterface::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。