本文整理汇总了PHP中TYPO3\Flow\Mvc\ActionRequest::getReferringRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionRequest::getReferringRequest方法的具体用法?PHP ActionRequest::getReferringRequest怎么用?PHP ActionRequest::getReferringRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Mvc\ActionRequest
的用法示例。
在下文中一共展示了ActionRequest::getReferringRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getReferringRequestThrowsAnExceptionIfTheHmacOfTheArgumentsCouldNotBeValid
/**
* @test
* @expectedException \TYPO3\Flow\Security\Exception\InvalidHashException
*/
public function getReferringRequestThrowsAnExceptionIfTheHmacOfTheArgumentsCouldNotBeValid()
{
$serializedArguments = base64_encode('some manipulated arguments string without valid HMAC');
$referrer = array('@controller' => 'Foo', '@action' => 'bar', 'arguments' => $serializedArguments);
$mockHashService = $this->getMockBuilder(\TYPO3\Flow\Security\Cryptography\HashService::class)->getMock();
$mockHashService->expects($this->once())->method('validateAndStripHmac')->with($serializedArguments)->will($this->throwException(new InvalidHashException()));
$this->inject($this->actionRequest, 'hashService', $mockHashService);
$this->actionRequest->setArgument('__referrer', $referrer);
$this->actionRequest->getReferringRequest();
}