function ExceptionLoggingSubscriberTest::exceptionDataProvider

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php \Drupal\KernelTests\Core\EventSubscriber\ExceptionLoggingSubscriberTest::exceptionDataProvider()

File

core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php, line 64

Class

ExceptionLoggingSubscriberTest
Tests that HTTP exceptions are logged correctly.

Namespace

Drupal\KernelTests\Core\EventSubscriber

Code

public static function exceptionDataProvider() : array {
  return [
    [
      400,
      'client error',
      RfcLogLevel::WARNING,
    ],
    [
      401,
      'client error',
      RfcLogLevel::WARNING,
    ],
    [
      403,
      'access denied',
      RfcLogLevel::WARNING,
    ],
    [
      404,
      'page not found',
      RfcLogLevel::WARNING,
    ],
    [
      405,
      'client error',
      RfcLogLevel::WARNING,
    ],
    [
      408,
      'client error',
      RfcLogLevel::WARNING,
    ],
    // Do not check the 500 status code here because it would be caught by
    // Drupal\Core\EventSubscriberExceptionTestSiteSubscriber which has lower
    // priority.
[
      501,
      'php',
      RfcLogLevel::ERROR,
    ],
    [
      502,
      'php',
      RfcLogLevel::ERROR,
    ],
    [
      503,
      'php',
      RfcLogLevel::ERROR,
    ],
  ];
}

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