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

ExceptionTest.php$0   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 4
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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