$exception =
new FormAjaxException($form,
$form_state);
$request =
new Request([],
['form_build_id' => 'the_build_id'
]);
$commands =
[];
$response =
new Response(''
);
$this->formAjaxResponseBuilder->
expects($this->
once()) ->
method('buildResponse'
) ->
with($request,
$expected_form,
$form_state,
$commands) ->
willReturn($response);
$this->
assertResponseFromException($request,
$exception,
$response);
$this->
assertTrue($this->event->
isAllowingCustomResponseCode());
$this->
assertSame(200,
$this->event->
getResponse()->
getStatusCode());
} /**
* @covers ::onException
*/
public function testOnExceptionNewBuildId() { $form =
['#type' => 'form', '#build_id' => 'the_build_id'
];
$expected_form =
$form +
[ '#build_id_old' => 'a_new_build_id',
];