diff --git a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php index 9a9fe4c..179b7ba 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php +++ b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php @@ -798,7 +798,7 @@ public function testFormTokenCacheability($token, $is_authenticated, $expected_f $form_state = new FormState(); $built_form = $this->formBuilder->buildForm($form_arg, $form_state); - if (!isset($expected_form_cacheability) || $method == 'get') { + if (!isset($expected_form_cacheability) || ($method == 'get' && !is_string($token))) { $this->assertFalse(isset($built_form['#cache'])); } else { @@ -826,6 +826,7 @@ function providerTestFormTokenCacheability() { 'token:false,authenticated:false' => [FALSE, FALSE, NULL, NULL, 'post'], 'token:false,authenticated:true' => [FALSE, TRUE, NULL, NULL, 'post'], 'token:none,authenticated:false,method:get' => [NULL, FALSE, ['contexts' => ['user.roles:authenticated']], NULL, 'get'], + 'token:test_form_id,authenticated:false,method:get' => ['test_form_id', TRUE, ['contexts' => ['user.roles:authenticated']], ['max-age' => 0], 'get'], ]; }