You are here

public function FileLogTokenTest::providerMessages in File Log 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/FileLogTokenTest.php \Drupal\Tests\filelog\Unit\FileLogTokenTest::providerMessages()

Data provider for messages.

Return value

array The datasets for ::testTokens().

File

tests/src/Unit/FileLogTokenTest.php, line 221

Class

FileLogTokenTest
Test the filelog message token integration.

Namespace

Drupal\Tests\filelog\Unit

Code

public function providerMessages() : array {
  return [
    [
      'level' => RfcLogLevel::EMERGENCY,
      'message' => 'This is a message.',
      'context' => [
        'uid' => 7,
        'ip' => '255.255.255.255',
        'timestamp' => 123456789,
        'channel' => 'channel1',
        'request_uri' => 'a/b/c',
      ],
    ],
    [
      'level' => RfcLogLevel::WARNING,
      'message' => 'This is message (@abc, %def, :ghi).',
      'context' => [
        '@abc' => '.LD5}5~\\"8AiU*VH',
        '%def' => '6(0XvYDAhZ9.Ecd ',
        ':ghi' => '7bU3p6ap4:G_1.w"',
        'uid' => -1,
        'channel' => 'channel2',
        'request_uri' => 'd/e/f',
        'timestamp' => 0,
      ],
    ],
    [
      'level' => RfcLogLevel::DEBUG,
      'message' => 'This is message (@abc).',
      'context' => [
        '@abc' => '7bU3p6ap4:G_1.w"',
        'uid' => 42,
        'ip' => '0.0.0.0',
        'timestamp' => 987654321,
        'referer' => 'https://localhost',
        'channel' => 'channel3',
        'request_uri' => 'g/h/i',
      ],
    ],
  ];
}