Passed
Pull Request — master (#3156)
by Sergei
12:45
created

PsrAdapterTest::testLogging()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace Doctrine\DBAL\Logging;
4
5
use Doctrine\DBAL\ParameterType;
6
use PHPUnit\Framework\TestCase;
7
use Psr\Log\LoggerInterface;
8
9
class PsrAdapterTest extends TestCase
10
{
11
    public function testLogging()
12
    {
13
        $logger = $this->createMock(LoggerInterface::class);
14
        $logger->expects($this->once())
15
            ->method('debug')
16
            ->with('SELECT name FROM users WHERE id = ?', [
17
                'params' => [1],
18
                'types' => [ParameterType::INTEGER],
19
            ]);
20
21
        $adapter = new PsrAdapter($logger);
22
        $adapter->startQuery('SELECT name FROM users WHERE id = ?', [1], [ParameterType::INTEGER]);
23
    }
24
}
25