You are here

public function WatchdogCheckTest::testOrder in Nagios Monitoring 8

File

tests/src/Kernel/WatchdogCheckTest.php, line 102

Class

WatchdogCheckTest
Tests the functionality to report dblog/watchdog entries.

Namespace

Drupal\Tests\nagios\Kernel

Code

public function testOrder() {
  $this
    ->getLogger('test')
    ->warning('warning 1');
  sleep(2);
  $this
    ->getLogger('test')
    ->warning('warning 2');
  $expected = [
    'status' => NAGIOS_STATUS_WARNING,
    'type' => 'state',
    'text' => 'test warning 2, test warning 1',
  ];
  self::expectWatchdog($expected);
}