You are here

public function FormAjaxResponseBuilderTest::testBuildResponseNoCallable in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php \Drupal\Tests\Core\Form\FormAjaxResponseBuilderTest::testBuildResponseNoCallable()
  2. 10 core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php \Drupal\Tests\Core\Form\FormAjaxResponseBuilderTest::testBuildResponseNoCallable()

@covers ::buildResponse

File

core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php, line 64

Class

FormAjaxResponseBuilderTest
@coversDefaultClass \Drupal\Core\Form\FormAjaxResponseBuilder @group Form

Namespace

Drupal\Tests\Core\Form

Code

public function testBuildResponseNoCallable() {
  $this->renderer
    ->expects($this
    ->never())
    ->method('renderResponse');
  $request = new Request();
  $form = [];
  $form_state = new FormState();
  $triggering_element = [];
  $form_state
    ->setTriggeringElement($triggering_element);
  $commands = [];
  $this
    ->expectException(HttpException::class);
  $this->formAjaxResponseBuilder
    ->buildResponse($request, $form, $form_state, $commands);
}