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


PHP NodeInterface::expects方法代码示例

本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Model\NodeInterface::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeInterface::expects方法的具体用法?PHP NodeInterface::expects怎么用?PHP NodeInterface::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\TYPO3CR\Domain\Model\NodeInterface的用法示例。


在下文中一共展示了NodeInterface::expects方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     $this->siteNode = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface');
     $this->firstLevelNode = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface');
     $this->secondLevelNode = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface');
     $this->siteNode->expects($this->any())->method('getPath')->will($this->returnValue('/site'));
     $this->siteNode->expects($this->any())->method('getChildNodes')->will($this->returnValue(array($this->firstLevelNode)));
     $this->mockContext = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Service\\Context')->disableOriginalConstructor()->getMock();
     $this->firstLevelNode->expects($this->any())->method('getParent')->will($this->returnValue($this->siteNode));
     $this->firstLevelNode->expects($this->any())->method('getPath')->will($this->returnValue('/site/first'));
     $this->secondLevelNode->expects($this->any())->method('getParent')->will($this->returnValue($this->siteNode));
     $this->secondLevelNode->expects($this->any())->method('getPath')->will($this->returnValue('/site/first/second'));
 }
开发者ID:sbruggmann,项目名称:neos-development-collection,代码行数:13,代码来源:ParentOperationTest.php

示例2: setUp

 public function setUp()
 {
     $this->convertEmailLinks = $this->getAccessibleMock('Networkteam\\Neos\\MailObfuscator\\Typoscript\\ConvertEmailLinksImplementation', array('getValue'), array(), '', FALSE);
     $this->mockContext = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Service\\Context')->disableOriginalConstructor()->getMock();
     $this->mockContext->expects($this->any())->method('getWorkspaceName')->will($this->returnValue('live'));
     $this->mockNode = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface')->getMock();
     $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContext));
     $this->mockTsRuntime = $this->getMockBuilder('TYPO3\\TypoScript\\Core\\Runtime')->disableOriginalConstructor()->getMock();
     $this->mockTsRuntime->expects($this->any())->method('getCurrentContext')->will($this->returnValue(array('node' => $this->mockNode)));
     $this->convertEmailLinks->_set('tsRuntime', $this->mockTsRuntime);
     $this->convertEmailLinks->_set('linkNameConverter', new \Networkteam\Neos\MailObfuscator\String\Converter\RewriteAtCharConverter());
     $this->convertEmailLinks->_set('mailToHrefConverter', new \Networkteam\Neos\MailObfuscator\String\Converter\Mailto2HrefObfuscatingConverter());
     srand(10);
 }
开发者ID:ComiR,项目名称:Networkteam.Neos.MailObfuscator,代码行数:14,代码来源:ConvertEmailLinksImplementationTest.php

示例3: setUp

 public function setUp()
 {
     $this->siteNode = $this->createMock(NodeInterface::class);
     $this->firstNodeInLevel = $this->createMock(NodeInterface::class);
     $this->secondNodeInLevel = $this->createMock(NodeInterface::class);
     $this->thirdNodeInLevel = $this->createMock(NodeInterface::class);
     $this->siteNode->expects($this->any())->method('getPath')->will($this->returnValue('/site'));
     $this->siteNode->expects($this->any())->method('getChildNodes')->will($this->returnValue(array($this->firstNodeInLevel, $this->secondNodeInLevel, $this->thirdNodeInLevel)));
     $this->mockContext = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
     $this->firstNodeInLevel->expects($this->any())->method('getParent')->will($this->returnValue($this->siteNode));
     $this->firstNodeInLevel->expects($this->any())->method('getPath')->will($this->returnValue('/site/first'));
     $this->secondNodeInLevel->expects($this->any())->method('getParent')->will($this->returnValue($this->siteNode));
     $this->secondNodeInLevel->expects($this->any())->method('getPath')->will($this->returnValue('/site/second'));
     $this->thirdNodeInLevel->expects($this->any())->method('getParent')->will($this->returnValue($this->siteNode));
     $this->thirdNodeInLevel->expects($this->any())->method('getPath')->will($this->returnValue('/site/third'));
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:16,代码来源:PrevAllOperationTest.php

示例4: setUp

 protected function setUp()
 {
     $this->service = new CacheControlService();
     $this->mockContentCacheAspect = $this->getMock('MOC\\Varnish\\Aspects\\ContentCacheAspect');
     $this->inject($this->service, 'contentCacheAspect', $this->mockContentCacheAspect);
     $this->mockLogger = $this->getMockBuilder('MOC\\Varnish\\Log\\LoggerInterface')->getMock();
     $this->inject($this->service, 'logger', $this->mockLogger);
     $this->contentCacheFrontend = new MetadataAwareStringFrontend('test', new TransientMemoryBackend(new ApplicationContext('Testing')));
     $this->contentCacheFrontend->initializeObject();
     $this->inject($this->service, 'contentCacheFrontend', $this->contentCacheFrontend);
     $this->mockTokenStorage = $this->getMock('MOC\\Varnish\\Service\\TokenStorage');
     $this->inject($this->service, 'tokenStorage', $this->mockTokenStorage);
     $this->mockRequest = $this->getMock('TYPO3\\Flow\\Mvc\\RequestInterface');
     $this->mockResponse = $this->getMock('TYPO3\\Flow\\Http\\Response');
     $this->mockController = $this->getMock('TYPO3\\Neos\\Controller\\Frontend\\NodeController');
     $this->mockControllerContext = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\Controller\\ControllerContext')->disableOriginalConstructor()->getMock();
     $this->mockController->expects($this->any())->method('getControllerContext')->willReturn($this->mockControllerContext);
     $this->mockArguments = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\Controller\\Arguments')->getMock();
     $this->mockControllerContext->expects($this->any())->method('getArguments')->willReturn($this->mockArguments);
     $this->mockArguments->expects($this->any())->method('hasArgument')->with('node')->willReturn(TRUE);
     $this->mockArgument = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\Controller\\Argument')->disableOriginalConstructor()->getMock();
     $this->mockArguments->expects($this->any())->method('getArgument')->with('node')->willReturn($this->mockArgument);
     $this->mockNode = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface');
     $this->mockArgument->expects($this->any())->method('getValue')->willReturn($this->mockNode);
     $this->mockContext = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Service\\Context')->disableOriginalConstructor()->getMock();
     $this->mockNode->expects($this->any())->method('getContext')->willReturn($this->mockContext);
 }
开发者ID:christophlehmann,项目名称:MOC.Varnish,代码行数:27,代码来源:CacheControlServiceTest.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $this->contentElementEditableService = new ContentElementEditableService();
     $this->mockPrivilegeManager = $this->getMockBuilder(PrivilegeManagerInterface::class)->getMock();
     $this->inject($this->contentElementEditableService, 'privilegeManager', $this->mockPrivilegeManager);
     $this->mockNodeAuthorizationService = $this->getMockBuilder(AuthorizationService::class)->getMock();
     $this->inject($this->contentElementEditableService, 'nodeAuthorizationService', $this->mockNodeAuthorizationService);
     $this->mockHtmlAugmenter = $this->getMockBuilder(HtmlAugmenter::class)->getMock();
     $this->inject($this->contentElementEditableService, 'htmlAugmenter', $this->mockHtmlAugmenter);
     $this->mockTsRuntime = $this->getMockBuilder('TYPO3\\TypoScript\\Core\\Runtime')->disableOriginalConstructor()->getMock();
     $this->mockContentContext = $this->getMockBuilder('TYPO3\\Neos\\Domain\\Service\\ContentContext')->disableOriginalConstructor()->getMock();
     $this->mockNode = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface')->getMock();
     $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContentContext));
     $this->mockNode->expects($this->any())->method('getNodeType')->will($this->returnValue(new NodeType('Acme.Test:Headline', [], [])));
     $this->mockTsContext = array('node' => $this->mockNode);
     $this->mockTsRuntime->expects($this->any())->method('getCurrentContext')->will($this->returnValue($this->mockTsContext));
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:18,代码来源:ContentElementEditableServiceTest.php

示例6: setUp

 public function setUp()
 {
     parent::setUp();
     $this->editableViewHelper = $this->getAccessibleMock('TYPO3\\Neos\\ViewHelpers\\ContentElement\\EditableViewHelper', array('renderChildren'));
     $this->mockPrivilegeManager = $this->getMockBuilder('TYPO3\\Flow\\Security\\Authorization\\PrivilegeManagerInterface')->getMock();
     $this->inject($this->editableViewHelper, 'privilegeManager', $this->mockPrivilegeManager);
     $this->mockNodeAuthorizationService = $this->getMockBuilder(AuthorizationService::class)->getMock();
     $this->inject($this->editableViewHelper, 'nodeAuthorizationService', $this->mockNodeAuthorizationService);
     $this->mockTemplateImplementation = $this->getMockBuilder('TYPO3\\TypoScript\\TypoScriptObjects\\TemplateImplementation')->disableOriginalConstructor()->getMock();
     $this->mockTsRuntime = $this->getMockBuilder('TYPO3\\TypoScript\\Core\\Runtime')->disableOriginalConstructor()->getMock();
     $this->mockContentContext = $this->getMockBuilder('TYPO3\\Neos\\Domain\\Service\\ContentContext')->disableOriginalConstructor()->getMock();
     $this->mockNode = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface')->getMock();
     $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContentContext));
     $this->mockTsContext = array('node' => $this->mockNode);
     $this->mockTsRuntime->expects($this->any())->method('getCurrentContext')->will($this->returnValue($this->mockTsContext));
     $this->mockTemplateImplementation->expects($this->any())->method('getTsRuntime')->will($this->returnValue($this->mockTsRuntime));
     $this->mockView = $this->getAccessibleMock('TYPO3\\TypoScript\\TypoScriptObjects\\Helpers\\FluidView', array(), array(), '', FALSE);
     $this->mockView->expects($this->any())->method('getTypoScriptObject')->will($this->returnValue($this->mockTemplateImplementation));
     $this->editableViewHelper->initializeArguments();
 }
开发者ID:radmiraal,项目名称:neos-development-collection,代码行数:20,代码来源:EditableViewHelperTest.php

示例7: setUp

 public function setUp()
 {
     $this->convertUrisImplementation = $this->getAccessibleMock('TYPO3\\Neos\\TypoScript\\ConvertUrisImplementation', array('tsValue'), array(), '', false);
     $this->mockWorkspace = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace')->disableOriginalConstructor()->getMock();
     $this->mockContext = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Service\\Context')->disableOriginalConstructor()->getMock();
     $this->mockContext->expects($this->any())->method('getWorkspace')->will($this->returnValue($this->mockWorkspace));
     $this->mockNode = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\NodeInterface')->getMock();
     $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContext));
     $this->mockHttpUri = $this->getMockBuilder('TYPO3\\Flow\\Http\\Uri')->disableOriginalConstructor()->getMock();
     $this->mockHttpUri->expects($this->any())->method('getHost')->will($this->returnValue('localhost'));
     $this->mockHttpRequest = $this->getMockBuilder('TYPO3\\Flow\\Http\\Request')->disableOriginalConstructor()->getMock();
     $this->mockHttpRequest->expects($this->any())->method('getUri')->will($this->returnValue($this->mockHttpUri));
     $this->mockActionRequest = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\ActionRequest')->disableOriginalConstructor()->getMock();
     $this->mockActionRequest->expects($this->any())->method('getHttpRequest')->will($this->returnValue($this->mockHttpRequest));
     $this->mockControllerContext = $this->getMockBuilder('TYPO3\\Flow\\Mvc\\Controller\\ControllerContext')->disableOriginalConstructor()->getMock();
     $this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockActionRequest));
     $this->mockLinkingService = $this->createMock('TYPO3\\Neos\\Service\\LinkingService');
     $this->convertUrisImplementation->_set('linkingService', $this->mockLinkingService);
     $this->mockTsRuntime = $this->getMockBuilder('TYPO3\\TypoScript\\Core\\Runtime')->disableOriginalConstructor()->getMock();
     $this->mockTsRuntime->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext));
     $this->convertUrisImplementation->_set('tsRuntime', $this->mockTsRuntime);
 }
开发者ID:hhoechtl,项目名称:neos-development-collection,代码行数:22,代码来源:ConvertUrisImplementationTest.php

示例8: setUp

 public function setUp()
 {
     $this->convertUrisImplementation = $this->getAccessibleMock(ConvertUrisImplementation::class, array('tsValue'), array(), '', false);
     $this->mockWorkspace = $this->getMockBuilder(Workspace::class)->disableOriginalConstructor()->getMock();
     $this->mockContext = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
     $this->mockContext->expects($this->any())->method('getWorkspace')->will($this->returnValue($this->mockWorkspace));
     $this->mockNode = $this->getMockBuilder(NodeInterface::class)->getMock();
     $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContext));
     $this->mockHttpUri = $this->getMockBuilder(Uri::class)->disableOriginalConstructor()->getMock();
     $this->mockHttpUri->expects($this->any())->method('getHost')->will($this->returnValue('localhost'));
     $this->mockHttpRequest = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock();
     $this->mockHttpRequest->expects($this->any())->method('getUri')->will($this->returnValue($this->mockHttpUri));
     $this->mockActionRequest = $this->getMockBuilder(ActionRequest::class)->disableOriginalConstructor()->getMock();
     $this->mockActionRequest->expects($this->any())->method('getHttpRequest')->will($this->returnValue($this->mockHttpRequest));
     $this->mockControllerContext = $this->getMockBuilder(ControllerContext::class)->disableOriginalConstructor()->getMock();
     $this->mockControllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->mockActionRequest));
     $this->mockLinkingService = $this->createMock(LinkingService::class);
     $this->convertUrisImplementation->_set('linkingService', $this->mockLinkingService);
     $this->mockTsRuntime = $this->getMockBuilder(Runtime::class)->disableOriginalConstructor()->getMock();
     $this->mockTsRuntime->expects($this->any())->method('getControllerContext')->will($this->returnValue($this->mockControllerContext));
     $this->convertUrisImplementation->_set('tsRuntime', $this->mockTsRuntime);
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:22,代码来源:ConvertUrisImplementationTest.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     $this->editableViewHelper = $this->getAccessibleMock(EditableViewHelper::class, array('renderChildren'));
     $this->mockPrivilegeManager = $this->getMockBuilder(PrivilegeManagerInterface::class)->getMock();
     $this->inject($this->editableViewHelper, 'privilegeManager', $this->mockPrivilegeManager);
     $this->mockNodeAuthorizationService = $this->getMockBuilder(AuthorizationService::class)->getMock();
     $this->inject($this->editableViewHelper, 'nodeAuthorizationService', $this->mockNodeAuthorizationService);
     $this->mockContentElementEditableService = $this->getMockBuilder(ContentElementEditableService::class)->getMock();
     $this->inject($this->editableViewHelper, 'contentElementEditableService', $this->mockContentElementEditableService);
     $this->mockTemplateImplementation = $this->getMockBuilder(TemplateImplementation::class)->disableOriginalConstructor()->getMock();
     $this->mockTsRuntime = $this->getMockBuilder(Runtime::class)->disableOriginalConstructor()->getMock();
     $this->mockContentContext = $this->getMockBuilder(ContentContext::class)->disableOriginalConstructor()->getMock();
     $this->mockNode = $this->getMockBuilder(NodeInterface::class)->getMock();
     $this->mockNode->expects($this->any())->method('getContext')->will($this->returnValue($this->mockContentContext));
     $this->mockNode->expects($this->any())->method('getNodeType')->will($this->returnValue(new NodeType('Acme.Test:Headline', [], [])));
     $this->mockTsContext = array('node' => $this->mockNode);
     $this->mockTsRuntime->expects($this->any())->method('getCurrentContext')->will($this->returnValue($this->mockTsContext));
     $this->mockTemplateImplementation->expects($this->any())->method('getTsRuntime')->will($this->returnValue($this->mockTsRuntime));
     $this->mockView = $this->getAccessibleMock(FluidView::class, array(), array(), '', false);
     $this->mockView->expects($this->any())->method('getTypoScriptObject')->will($this->returnValue($this->mockTemplateImplementation));
     $this->editableViewHelper->initializeArguments();
 }
开发者ID:johannessteu,项目名称:neos-development-collection,代码行数:23,代码来源:EditableViewHelperTest.php

示例10: buildFlowQueryWithNodeInContext

 /**
  * @param NodeInterface $mockNode
  * @param array $nodeContextProperties
  * @return FlowQuery
  */
 protected function buildFlowQueryWithNodeInContext($mockNode, $nodeContextProperties)
 {
     $mockNodeContext = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Service\\Context')->disableOriginalConstructor()->getMock();
     $mockNodeContext->expects($this->any())->method('getProperties')->will($this->returnValue($nodeContextProperties));
     $mockNode->expects($this->any())->method('getContext')->will($this->returnValue($mockNodeContext));
     $mockFlowQuery = $this->getMockBuilder('TYPO3\\Eel\\FlowQuery\\FlowQuery')->disableOriginalConstructor()->getMock();
     $mockFlowQuery->expects($this->any())->method('getContext')->will($this->returnValue(array($mockNode)));
     return $mockFlowQuery;
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:14,代码来源:ContextOperationTest.php

示例11: buildFlowQueryWithNodeInContext

 /**
  * @param NodeInterface $mockNode
  * @param array $nodeContextProperties
  * @return FlowQuery
  */
 protected function buildFlowQueryWithNodeInContext($mockNode, $nodeContextProperties)
 {
     $mockNodeContext = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock();
     $mockNodeContext->expects($this->any())->method('getProperties')->will($this->returnValue($nodeContextProperties));
     $mockNode->expects($this->any())->method('getContext')->will($this->returnValue($mockNodeContext));
     $mockFlowQuery = $this->getMockBuilder(FlowQuery::class)->disableOriginalConstructor()->getMock();
     $mockFlowQuery->expects($this->any())->method('getContext')->will($this->returnValue(array($mockNode)));
     return $mockFlowQuery;
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:14,代码来源:ContextOperationTest.php


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