You are here

public function JsonLogTest::testCannotPrepareLogFileIfThresholdExceeded in JSONlog 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/JsonLogTest.php \Drupal\Tests\jsonlog\Unit\JsonLogTest::testCannotPrepareLogFileIfThresholdExceeded()
  2. 3.x tests/src/Unit/JsonLogTest.php \Drupal\Tests\jsonlog\Unit\JsonLogTest::testCannotPrepareLogFileIfThresholdExceeded()

test to see if a log file is not prepared when the log-level is too high

File

tests/src/Unit/JsonLogTest.php, line 103

Class

JsonLogTest
Unit tests for JsonLog class

Namespace

Drupal\Tests\jsonlog\Unit

Code

public function testCannotPrepareLogFileIfThresholdExceeded() {
  $level = self::DEFAULT_THRESHOLD + 1;
  $log_entry = $this->jsonLogger
    ->prepareLog($level, 'test', []);
  $this
    ->assertTrue($log_entry === FALSE, 'Log entry not built');
}