You are here

public function FormBuilderTest::testGetFormWithString in Drupal 8

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

Tests the getForm() method with a string based form ID.

File

core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php, line 217
Contains \Drupal\Tests\Core\Form\FormBuilderTest.

Class

FormBuilderTest
@coversDefaultClass \Drupal\Core\Form\FormBuilder @group Form

Namespace

Drupal\Tests\Core\Form

Code

public function testGetFormWithString() {
  $form_id = 'test_form_id';
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('The form argument test_form_id is not a valid form.');
  $this->formBuilder
    ->getForm($form_id);
}