function AjaxFormPageCacheTest::getFormBuildId

Same name in other branches
  1. 8.9.x core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormPageCacheTest::getFormBuildId()
  2. 10 core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormPageCacheTest::getFormBuildId()
  3. 11.x core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormPageCacheTest::getFormBuildId()

Return the build id of the current form.

1 call to AjaxFormPageCacheTest::getFormBuildId()
AjaxFormPageCacheTest::testSimpleAJAXFormValue in core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
Create a simple form, then submit the form via AJAX to change to it.

File

core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php, line 38

Class

AjaxFormPageCacheTest
Performs tests on AJAX forms in cached pages.

Namespace

Drupal\FunctionalJavascriptTests\Ajax

Code

protected function getFormBuildId() {
    // Ensure the hidden 'form_build_id' field is unique.
    $this->assertSession()
        ->elementsCount('xpath', '//input[@name="form_build_id"]', 1);
    return $this->assertSession()
        ->hiddenFieldExists('form_build_id')
        ->getValue();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.