function EntityCreateAccessCustomCidTest::providerTestDefaultCid

Provides test cases for ::testDefaultCid().

Return value

array[] A list of test cases.

File

core/tests/Drupal/Tests/Core/Entity/Access/EntityCreateAccessCustomCidTest.php, line 159

Class

EntityCreateAccessCustomCidTest
Tests entity access control handler custom internal cache ID.

Namespace

Drupal\Tests\Core\Entity\Access

Code

public static function providerTestDefaultCid() : array {
  return [
    'no context, cached' => [
      'context' => [],
      'in_cache' => TRUE,
      'cacheable' => TRUE,
    ],
    'no context, uncached' => [
      'context' => [],
      'in_cache' => FALSE,
      'cacheable' => TRUE,
    ],
    'one context var, cached' => [
      'context' => [
        'context_var1' => 'val1',
      ],
      'in_cache' => TRUE,
      'cacheable' => FALSE,
    ],
    'one context var, uncached' => [
      'context' => [
        'context_var1' => 'val1',
      ],
      'in_cache' => FALSE,
      'cacheable' => FALSE,
    ],
    'two context vars, cached' => [
      'context' => [
        'context_var1' => 'val1',
        'context_var2' => 'val2',
      ],
      'in_cache' => TRUE,
      'cacheable' => FALSE,
    ],
    'two context vars, uncached' => [
      'context' => [
        'context_var1' => 'val1',
        'context_var2' => 'val2',
      ],
      'in_cache' => FALSE,
      'cacheable' => FALSE,
    ],
  ];
}

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