Completed
Pull Request — master (#954)
by Dimitri
01:58
created

BacktraceLoggerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBacktraceLogged() 0 10 1
1
<?php
2
3
namespace Doctrine\Bundle\DoctrineBundle\Tests\Dbal\Logging;
4
5
use Doctrine\Bundle\DoctrineBundle\Dbal\Logging\BacktraceLogger;
6
use PHPUnit\Framework\TestCase;
7
8
class BacktraceLoggerTest extends TestCase
9
{
10
    public function testBacktraceLogged() : void
11
    {
12
        $logger = new BacktraceLogger();
13
        $logger->startQuery('SELECT column FROM table');
14
        $currentQuery = current($logger->queries);
15
        self::assertSame('SELECT column FROM table', $currentQuery['sql']);
16
        self::assertNull($currentQuery['params']);
17
        self::assertNull($currentQuery['types']);
18
        self::assertCount(11, $currentQuery['backtrace']);
19
    }
20
}
21