public function redirectUsesRequestFormatAsDefaultAndUnsetsSubPackageKeyIfNecessary()
{
$arguments = ['foo' => 'bar'];
$this->mockActionRequest->expects($this->atLeastOnce())->method('getFormat')->will($this->returnValue('json'));
$mockUriBuilder = $this->createMock(UriBuilder::class);
$mockUriBuilder->expects($this->once())->method('reset')->will($this->returnValue($mockUriBuilder));
$mockUriBuilder->expects($this->once())->method('setFormat')->with('json')->will($this->returnValue($mockUriBuilder));
$mockUriBuilder->expects($this->once())->method('setCreateAbsoluteUri')->will($this->returnValue($mockUriBuilder));
$mockUriBuilder->expects($this->once())->method('uriFor')->with('show', $arguments, 'Stuff', 'Super', null)->will($this->returnValue('the uri'));
$controller = $this->getAccessibleMock(AbstractController::class, ['processRequest', 'redirectToUri']);
$controller->_call('initializeController', $this->mockActionRequest, $this->mockHttpResponse);
$this->inject($controller, 'uriBuilder', $mockUriBuilder);
$controller->expects($this->once())->method('redirectToUri')->with('the uri');
$controller->_call('redirect', 'show', 'Stuff', 'Super', $arguments);
}