You are here

public function FormBuilderTest::testGetFormIdWithString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::testGetFormIdWithString()

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

@expectedException \InvalidArgumentException @expectedExceptionMessage The form argument foo is not a valid form.

File

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

Class

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

Namespace

Drupal\Tests\Core\Form

Code

public function testGetFormIdWithString() {
  $form_arg = 'foo';
  $clean_form_state = new FormState();
  $form_state = new FormState();
  $form_id = $this->formBuilder
    ->getFormId($form_arg, $form_state);
  $this
    ->assertSame($form_arg, $form_id);
  $this
    ->assertSame($clean_form_state, $form_state);
}