function FapiExampleTest::doTestSimpleFormExample

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

Check routes defined by form_api_example.

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

File

modules/form_api_example/tests/src/Functional/FapiExampleTest.php, line 240

Class

FapiExampleTest
Ensure that the form_api_example forms work properly.

Namespace

Drupal\Tests\form_api_example\Functional

Code

public function doTestSimpleFormExample() {
    $assert = $this->assertSession();
    // Post a title.
    $edit = [
        'title' => 'My Custom Title',
    ];
    $this->drupalGet(Url::fromRoute('form_api_example.simple_form'));
    $this->submitForm($edit, 'Submit');
    $assert->pageTextContains('You specified a title of My Custom Title.');
}