public function forwardSetsSubpackageKeyIfNeeded()
{
$mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);
$mockPersistenceManager->expects($this->any())->method('convertObjectsToIdentityArrays')->will($this->returnArgument(0));
$controller = $this->getAccessibleMock(AbstractController::class, ['processRequest']);
$this->inject($controller, 'persistenceManager', $mockPersistenceManager);
$controller->_call('initializeController', $this->mockActionRequest, $this->mockHttpResponse);
$this->mockActionRequest->expects($this->atLeastOnce())->method('setControllerActionName')->with('theTarget');
$this->mockActionRequest->expects($this->atLeastOnce())->method('setControllerName')->with('Bar');
$this->mockActionRequest->expects($this->atLeastOnce())->method('setControllerPackageKey')->with('MyPackage');
$this->mockActionRequest->expects($this->atLeastOnce())->method('setControllerSubpackageKey')->with('MySubPackage');
try {
$controller->_call('forward', 'theTarget', 'Bar', 'MyPackage\\MySubPackage', ['foo' => 'bar']);
} catch (ForwardException $exception) {
}
}