public function FormBuilderTest::testGetFormWithString in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::testGetFormWithString()
Tests the getForm() method with a string based form ID.
@expectedException \InvalidArgumentException @expectedExceptionMessage The form argument test_form_id is not a valid form.
File
- core/
tests/ Drupal/ Tests/ Core/ Form/ FormBuilderTest.php, line 225 - Contains \Drupal\Tests\Core\Form\FormBuilderTest.
Class
- FormBuilderTest
- @coversDefaultClass \Drupal\Core\Form\FormBuilder @group Form
Namespace
Drupal\Tests\Core\FormCode
public function testGetFormWithString() {
$form_id = 'test_form_id';
$expected_form = $form_id();
$form = $this->formBuilder
->getForm($form_id);
$this
->assertFormElement($expected_form, $form, 'test');
$this
->assertSame('test-form-id', $form['#id']);
}