function FormBuilderTest::providerTestFormTokenCacheability

Data provider for testFormTokenCacheability.

Return value

array An array of test cases, each containing a form token, the authentication, request method, and expected cacheability outcome.

File

core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php, line 1065

Class

FormBuilderTest
Tests Drupal\Core\Form\FormBuilder.

Namespace

Drupal\Tests\Core\Form

Code

public static function providerTestFormTokenCacheability() : array {
  return [
    'token:none,authenticated:true' => [
      NULL,
      TRUE,
      'post',
      FALSE,
    ],
    'token:none,authenticated:true,opted_in_for_cache' => [
      NULL,
      TRUE,
      'post',
      TRUE,
    ],
    'token:none,authenticated:false' => [
      NULL,
      FALSE,
      'post',
      FALSE,
    ],
    'token:false,authenticated:false' => [
      FALSE,
      FALSE,
      'post',
      FALSE,
    ],
    'token:false,authenticated:true' => [
      FALSE,
      TRUE,
      'post',
      FALSE,
    ],
    'token:none,authenticated:false,method:get' => [
      NULL,
      FALSE,
      'get',
      FALSE,
    ],
    'token:test_form_id,authenticated:false,method:get' => [
      'test_form_id',
      TRUE,
      'get',
      FALSE,
    ],
  ];
}

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