You are here

public function FapiExampleTest::doTestSimpleFormExample in Examples for Developers 8

Same name and namespace 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 form_api_example/tests/src/Functional/FapiExampleTest.php
Aggregate all the tests.

File

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

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
    ->drupalPostForm(Url::fromRoute('form_api_example.simple_form'), $edit, 'Submit');
  $assert
    ->pageTextContains('You specified a title of My Custom Title.');
}