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

InvalidColumnIndexTest::testNewPlural()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
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