You are here

public function CacheableExceptionTest::providerTestExceptions in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Http/CacheableExceptionTest.php \Drupal\Tests\Core\Http\CacheableExceptionTest::providerTestExceptions()

File

core/tests/Drupal/Tests/Core/Http/CacheableExceptionTest.php, line 60

Class

CacheableExceptionTest
@group Http

Namespace

Drupal\Tests\Core\Http

Code

public function providerTestExceptions() {
  return [
    [
      400,
      CacheableBadRequestHttpException::class,
    ],
    [
      401,
      CacheableUnauthorizedHttpException::class,
      'test challenge',
      [
        'WWW-Authenticate' => 'test challenge',
      ],
    ],
    [
      403,
      CacheableAccessDeniedHttpException::class,
    ],
    [
      404,
      CacheableNotFoundHttpException::class,
    ],
    [
      405,
      CacheableMethodNotAllowedHttpException::Class,
      [
        'POST',
        'PUT',
      ],
      [
        'Allow' => 'POST, PUT',
      ],
    ],
    [
      406,
      CacheableNotAcceptableHttpException::class,
    ],
    [
      409,
      CacheableConflictHttpException::class,
    ],
    [
      410,
      CacheableGoneHttpException::class,
    ],
    [
      411,
      CacheableLengthRequiredHttpException::class,
    ],
    [
      412,
      CacheablePreconditionFailedHttpException::class,
    ],
    [
      415,
      CacheableUnsupportedMediaTypeHttpException::class,
    ],
    [
      422,
      CacheableUnprocessableEntityHttpException::class,
    ],
    [
      428,
      CacheablePreconditionRequiredHttpException::class,
    ],
    [
      429,
      CacheableTooManyRequestsHttpException::class,
      60,
      [
        'Retry-After' => 60,
      ],
    ],
    [
      503,
      CacheableServiceUnavailableHttpException::class,
      60,
      [
        'Retry-After' => 60,
      ],
    ],
  ];
}