本文整理汇总了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);
}
示例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());
}