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


PHP Context::expects方法代码示例

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


在下文中一共展示了Context::expects方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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->mockContext->expects($this->any())->method('getCurrentSiteNode')->will($this->returnValue($this->siteNode));
     $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:mgoldbeck,项目名称:neos-development-collection,代码行数:14,代码来源: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: addHeadersInLiveWorkspaceAndCachedResponseAddsSiteToken

 /**
  * @test
  */
 public function addHeadersInLiveWorkspaceAndCachedResponseAddsSiteToken()
 {
     $this->mockContext->expects($this->any())->method('getWorkspaceName')->willReturn('live');
     $this->mockTokenStorage->expects($this->any())->method('getToken')->willReturn('RandomSiteToken');
     $this->mockResponse->expects($this->at(0))->method('setHeader')->with('X-Site', 'RandomSiteToken');
     $this->service->addHeaders($this->mockRequest, $this->mockResponse, $this->mockController);
 }
开发者ID:christophlehmann,项目名称:MOC.Varnish,代码行数:10,代码来源:CacheControlServiceTest.php

示例4: 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

示例5: 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


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