You are here

protected function AjaxFormPageCacheTest::getFormBuildId in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php \Drupal\FunctionalJavascriptTests\Ajax\AjaxFormPageCacheTest::getFormBuildId()
  2. 9 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();
}