Skip to content

Commit

Permalink
Add simple PsrLogger test (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Jan 13, 2022
1 parent 2319b3d commit cbe3030
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/Logger/PsrLoggerTest.php
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace SimPod\ClickHouseClient\Tests\Logger;

use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use SimPod\ClickHouseClient\Logger\PsrLogger;

/** @covers \SimPod\ClickHouseClient\Logger\PsrLogger */
final class PsrLoggerTest extends TestCase
{
public function testStartQuery() : void
{
$logger = $this->createMock(LoggerInterface::class);
$logger->expects(self::once())
->method('debug')
->withConsecutive(['SELECT 1', []]);

$psrLogger = new PsrLogger($logger);
$psrLogger->startQuery('oioi', 'SELECT 1');
$psrLogger->stopQuery('oioi');
}
}

0 comments on commit cbe3030

Please sign in to comment.