function FormBuilderTest::testBuildFormWithString
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::testBuildFormWithString()
- 8.9.x core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::testBuildFormWithString()
- 11.x core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::testBuildFormWithString()
Tests the buildForm() method with a string based form ID.
File
-
core/
tests/ Drupal/ Tests/ Core/ Form/ FormBuilderTest.php, line 268
Class
- FormBuilderTest
- @coversDefaultClass \Drupal\Core\Form\FormBuilder @group Form
Namespace
Drupal\Tests\Core\FormCode
public function testBuildFormWithString() : void {
$form_id = 'test_form_id';
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The form class test_form_id could not be found or loaded.');
$this->formBuilder
->getForm($form_id);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.