function FapiExampleTest::doTestModalForm

Same name in other branches
  1. 3.x modules/form_api_example/tests/src/Functional/FapiExampleTest.php \Drupal\Tests\form_api_example\Functional\FapiExampleTest::doTestModalForm()
  2. 4.0.x modules/form_api_example/tests/src/Functional/FapiExampleTest.php \Drupal\Tests\form_api_example\Functional\FapiExampleTest::doTestModalForm()

Test the modal form.

1 call to FapiExampleTest::doTestModalForm()
FapiExampleTest::testFunctional in form_api_example/tests/src/Functional/FapiExampleTest.php
Aggregate all the tests.

File

form_api_example/tests/src/Functional/FapiExampleTest.php, line 220

Class

FapiExampleTest
Ensure that the form_api_example forms work properly.

Namespace

Drupal\Tests\form_api_example\Functional

Code

public function doTestModalForm() {
    $assert = $this->assertSession();
    // Post the form.
    $edit = [
        'title' => 'My Book',
    ];
    $this->drupalPostForm(Url::fromRoute('form_api_example.modal_form'), $edit, 'Submit');
    $assert->pageTextContains('Submit handler: You specified a title of My Book.');
}