public function handleSetsWidgetContextAndControllerObjectNameIfWidgetIdIsPresent()
{
$mockWidgetId = 'SomeWidgetId';
$mockControllerObjectName = 'SomeControllerObjectName';
$this->mockHttpRequest->expects($this->at(0))->method('hasArgument')->with('__widgetId')->will($this->returnValue(true));
$this->mockHttpRequest->expects($this->atLeastOnce())->method('getArgument')->with('__widgetId')->will($this->returnValue($mockWidgetId));
$mockWidgetContext = $this->getMockBuilder(\Neos\FluidAdaptor\Core\Widget\WidgetContext::class)->getMock();
$mockWidgetContext->expects($this->atLeastOnce())->method('getControllerObjectName')->will($this->returnValue($mockControllerObjectName));
$this->mockAjaxWidgetContextHolder->expects($this->atLeastOnce())->method('get')->with($mockWidgetId)->will($this->returnValue($mockWidgetContext));
$mockActionRequest = $this->getMockBuilder(\Neos\Flow\Mvc\ActionRequest::class)->disableOriginalConstructor()->getMock();
$this->mockObjectManager->expects($this->atLeastOnce())->method('get')->with(\Neos\Flow\Mvc\ActionRequest::class)->will($this->returnValue($mockActionRequest));
$mockActionRequest->expects($this->once())->method('setArgument')->with('__widgetContext', $mockWidgetContext);
$mockActionRequest->expects($this->once())->method('setControllerObjectName')->with($mockControllerObjectName);
$this->ajaxWidgetComponent->handle($this->mockComponentContext);
}