/**
* @test
* @expectedException \Neos\Flow\Security\Exception\InvalidHashException
*/
public function getReferringRequestThrowsAnExceptionIfTheHmacOfTheArgumentsCouldNotBeValid()
{
$serializedArguments = base64_encode('some manipulated arguments string without valid HMAC');
$referrer = ['@controller' => 'Foo', '@action' => 'bar', 'arguments' => $serializedArguments];
$mockHashService = $this->getMockBuilder(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();
}