function FapiExampleTest::doTestStateDemoForm

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

Test the state demo form.

1 call to FapiExampleTest::doTestStateDemoForm()
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 253

Class

FapiExampleTest
Ensure that the form_api_example forms work properly.

Namespace

Drupal\Tests\form_api_example\Functional

Code

public function doTestStateDemoForm() {
    $assert = $this->assertSession();
    // Post the form.
    $edit = [
        'needs_accommodation' => TRUE,
        'diet' => 'vegan',
    ];
    $this->drupalGet(Url::fromRoute('form_api_example.state_demo'));
    $this->submitForm($edit, 'Submit');
    $assert->pageTextContains('Dietary Restriction Requested: vegan');
}