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


PHP ActionRequest::setControllerPackageKey方法代码示例

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


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

示例1: setUp

 /**
  * @return void
  */
 public function setUp()
 {
     $this->viewHelperVariableContainer = $this->getMock('TYPO3\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
     $this->templateVariableContainer = $this->getMock('TYPO3\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer');
     $this->uriBuilder = $this->getMock('TYPO3\\Flow\\Mvc\\Routing\\UriBuilder');
     $this->uriBuilder->expects($this->any())->method('reset')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setArguments')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setSection')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setFormat')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setCreateAbsoluteUri')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setAddQueryString')->will($this->returnValue($this->uriBuilder));
     $this->uriBuilder->expects($this->any())->method('setArgumentsToBeExcludedFromQueryString')->will($this->returnValue($this->uriBuilder));
     // BACKPORTER TOKEN #1
     $httpRequest = \TYPO3\Flow\Http\Request::create(new \TYPO3\Flow\Http\Uri('http://localhost/foo'));
     $this->request = $this->getMock('TYPO3\\Flow\\Mvc\\ActionRequest', array(), array($httpRequest));
     $this->request->setControllerPackageKey('TYPO3.Fluid');
     $this->request->expects($this->any())->method('isMainRequest')->will($this->returnValue(TRUE));
     $this->controllerContext = $this->getMock('TYPO3\\Flow\\Mvc\\Controller\\ControllerContext', array(), array(), '', FALSE);
     $this->controllerContext->expects($this->any())->method('getUriBuilder')->will($this->returnValue($this->uriBuilder));
     $this->controllerContext->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
     $this->tagBuilder = $this->getMock('TYPO3\\Fluid\\Core\\ViewHelper\\TagBuilder');
     $this->arguments = array();
     $this->renderingContext = new \TYPO3\Fluid\Core\Rendering\RenderingContext();
     $this->renderingContext->injectTemplateVariableContainer($this->templateVariableContainer);
     $this->renderingContext->injectViewHelperVariableContainer($this->viewHelperVariableContainer);
     $this->renderingContext->setControllerContext($this->controllerContext);
 }
开发者ID:sokunthearith,项目名称:Intern-Project-Week-2,代码行数:30,代码来源:ViewHelperBaseTestcase.php

示例2: setControllerPackageKeyWithLowercasePackageKeyResolvesCorrectly

 /**
  * @test
  */
 public function setControllerPackageKeyWithLowercasePackageKeyResolvesCorrectly()
 {
     $mockPackageManager = $this->getMock(\TYPO3\Flow\Package\PackageManager::class);
     $mockPackageManager->expects($this->any())->method('getCaseSensitivePackageKey')->with('acme.testpackage')->will($this->returnValue('Acme.Testpackage'));
     $this->inject($this->actionRequest, 'packageManager', $mockPackageManager);
     $this->actionRequest->setControllerPackageKey('acme.testpackage');
     $this->assertEquals('Acme.Testpackage', $this->actionRequest->getControllerPackageKey());
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:11,代码来源:ActionRequestTest.php


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