You are here

protected function FormStoragePageCacheTest::getFormBuildId in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php \Drupal\Tests\system\Functional\Form\FormStoragePageCacheTest::getFormBuildId()
  2. 9 core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php \Drupal\Tests\system\Functional\Form\FormStoragePageCacheTest::getFormBuildId()

Return the build id of the current form.

2 calls to FormStoragePageCacheTest::getFormBuildId()
FormStoragePageCacheTest::testRebuildFormStorageOnCachedPage in core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php
Build-id is regenerated when rebuilding cached form.
FormStoragePageCacheTest::testValidateFormStorageOnCachedPage in core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php
Build-id is regenerated when validating cached form.

File

core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php, line 38

Class

FormStoragePageCacheTest
Tests form storage from cached pages.

Namespace

Drupal\Tests\system\Functional\Form

Code

protected function getFormBuildId() {

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