Passed
Pull Request — master (#3353)
by Sean
14:43
created

AbstractDriverExceptionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
rs 10
c 0
b 0
f 0
eloc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hp$0 ➔ __construct() 0 3 1
A hp$0 ➔ testCanSetPreviousException() 0 12 1
testCanSetPreviousException() 0 12 ?
1
<?php
2
3
namespace Doctrine\Tests\DBAL\Driver;
4
5
use Doctrine\DBAL\Driver\AbstractDriverException;
6
use Exception;
7
use PHPUnit\Framework\TestCase;
8
use Throwable;
9
10
class AbstractDriverExceptionTest extends TestCase
11
{
12
    public function testCanSetPreviousException()
13
    {
14
        $previous = new Exception();
15
16
        $abstractDriverException = new class($previous) extends AbstractDriverException {
17
            public function __construct(Throwable $previous)
18
            {
19
                parent::__construct('', null, null, $previous);
20
            }
21
        };
22
23
        $this->assertSame($previous, $abstractDriverException->getPrevious());
24
    }
25
}
26