function ExceptionStatusCodeCacheContextTest::providerTestGetContext

Same name and namespace in other branches
  1. main core/tests/Drupal/Tests/Core/Cache/Context/ExceptionStatusCodeCacheContextTest.php \Drupal\Tests\Core\Cache\Context\ExceptionStatusCodeCacheContextTest::providerTestGetContext()

Provides a list of cookies and expected cache contexts.

File

core/tests/Drupal/Tests/Core/Cache/Context/ExceptionStatusCodeCacheContextTest.php, line 44

Class

ExceptionStatusCodeCacheContextTest
Tests Drupal\Core\Cache\Context\CookiesCacheContext.

Namespace

Drupal\Tests\Core\Cache\Context

Code

public static function providerTestGetContext() : array {
  return [
    [
      new NotFoundHttpException(),
      '404',
    ],
    [
      new AccessDeniedHttpException(),
      '403',
    ],
    [
      new BadRequestHttpException(),
      '400',
    ],
    [
      new MethodNotAllowedHttpException([
        'POST',
      ]),
      '405',
    ],
    [
      NULL,
      '0',
    ],
  ];
}

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