Failed Conditions
Pull Request — develop (#3525)
by Jonathan
09:58
created

InvalidColumnIndexTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 16
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testNewPlural() 0 6 1
A testNew() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\DBAL\Exception;
6
7
use Doctrine\DBAL\DBALException;
8
use Doctrine\DBAL\Exception\InvalidColumnIndex;
9
use PHPUnit\Framework\TestCase;
10
11
class InvalidColumnIndexTest extends TestCase
12
{
13
    public function testNew() : void
14
    {
15
        $exception = InvalidColumnIndex::new(5, 1);
16
17
        self::assertInstanceOf(DBALException::class, $exception);
18
        self::assertSame('Invalid column index 5. The statement result contains 1 column.', $exception->getMessage());
19
    }
20
21
    public function testNewPlural() : void
22
    {
23
        $exception = InvalidColumnIndex::new(5, 2);
24
25
        self::assertInstanceOf(DBALException::class, $exception);
26
        self::assertSame('Invalid column index 5. The statement result contains 2 columns.', $exception->getMessage());
27
    }
28
}
29