You are here

public function LoggerChannelPartTest::testLog in Purge 8.3

@covers ::log

@dataProvider providerTestLog()

File

tests/src/Unit/Logger/LoggerChannelPartTest.php, line 247

Class

LoggerChannelPartTest
@coversDefaultClass \Drupal\purge\Logger\LoggerChannelPart

Namespace

Drupal\Tests\purge\Unit\Logger

Code

public function testLog($id, $level, $message, $output) : void {
  $this->loggerChannelPurge
    ->expects($this
    ->once())
    ->method('log')
    ->with($this
    ->stringContains($level), $this
    ->stringContains('@purge_channel_part: ' . $message), $this
    ->callback(function ($subject) use ($id, $output) {
    return $subject['@purge_channel_part'] === $id && $subject['@replaceme'] === $output;
  }));
  $part = new LoggerChannelPart($this->loggerChannelPurge, $id);
  $part
    ->log($level, $message, [
    '@replaceme' => $output,
  ]);
}