getMockForm example

$this->assertSame('test_form', $form_id);
    $this->assertSame($form_argget_class($form_state->getFormObject()));
  }

  /** * Tests the getFormId() method with a form object. */
  public function testGetFormIdWithObject() {
    $expected_form_id = 'my_module_form_id';

    $form_arg = $this->getMockForm($expected_form_id);

    $form_state = new FormState();
    $form_id = $this->formBuilder->getFormId($form_arg$form_state);

    $this->assertSame($expected_form_id$form_id);
    $this->assertSame($form_arg$form_state->getFormObject());
  }

  /** * Tests the getFormId() method with a base form object. */
  
Home | Imprint | This part of the site doesn't use cookies.