You are here

public function LogsHttpLoggerTest::testIsEnabled in Logs HTTP 8

Tests isEnabled method.

@covers ::isEnabled @dataProvider isEnabledProvider

File

tests/src/Unit/LogsHttpLoggerTest.php, line 60

Class

LogsHttpLoggerTest
Tests the Logs Http logger service.

Namespace

Drupal\Tests\logs_http\Unit

Code

public function testIsEnabled($enabled, $url, $expected) {
  $this->config
    ->get('enabled')
    ->willReturn($enabled);
  $this->config
    ->get('url')
    ->willReturn($url);
  $logger = new LogsHttpLogger($this->config
    ->reveal(), $this->logMessageParser
    ->reveal());
  $result = $logger
    ->isEnabled();
  $this
    ->assertEquals($expected, $result);
}