You are here

public function FormAjaxSubscriberTest::testOnExceptionNestedWrongException in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php \Drupal\Tests\Core\Form\EventSubscriber\FormAjaxSubscriberTest::testOnExceptionNestedWrongException()
  2. 10 core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php \Drupal\Tests\Core\Form\EventSubscriber\FormAjaxSubscriberTest::testOnExceptionNestedWrongException()

@covers ::getFormAjaxException

File

core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php, line 238

Class

FormAjaxSubscriberTest
@coversDefaultClass \Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber @group EventSubscriber

Namespace

Drupal\Tests\Core\Form\EventSubscriber

Code

public function testOnExceptionNestedWrongException() {
  $nested_exception = new \Exception();
  $exception = new \Exception('', 0, $nested_exception);
  $request = new Request();
  $this->formAjaxResponseBuilder
    ->expects($this
    ->never())
    ->method('buildResponse');
  $this
    ->assertResponseFromException($request, $exception, NULL);
}