public function FormBuilderTest::testGetFormIdWithString in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::testGetFormIdWithString()
Tests the getFormId() method with a string based form ID.
File
- core/
tests/ Drupal/ Tests/ Core/ Form/ FormBuilderTest.php, line 57 - Contains \Drupal\Tests\Core\Form\FormBuilderTest.
Class
- FormBuilderTest
- @coversDefaultClass \Drupal\Core\Form\FormBuilder @group Form
Namespace
Drupal\Tests\Core\FormCode
public function testGetFormIdWithString() {
$form_arg = 'foo';
$form_state = new FormState();
$this
->expectException(\InvalidArgumentException::class);
$this
->expectExceptionMessage('The form argument foo is not a valid form.');
$this->formBuilder
->getFormId($form_arg, $form_state);
}