Failed Conditions
Pull Request — develop (#3536)
by Jonathan
64:40
created

FormatVariableTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFormatVariable() 0 3 1
A provideDataForFormatVariable() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\DBAL\Exception;
6
7
use Doctrine\DBAL\Exception\FormatVariable;
8
use PHPUnit\Framework\TestCase;
9
use stdClass;
10
use function tmpfile;
11
12
class FormatVariableTest extends TestCase
13
{
14
    /**
15
     * @dataProvider provideDataForFormatVariable
16
     */
17
    public function testFormatVariable($expected, $value) : void
18
    {
19
        self::assertSame($expected, (new FormatVariable())->__invoke($value));
20
    }
21
22
    /**
23
     * @return array<int, array<int, mixed>>
24
     */
25
    public function provideDataForFormatVariable() : array
26
    {
27
        return [
28
            ['', ''],
29
            ['test', 'test'],
30
            ['NULL', null],
31
            ['stdClass', new stdClass()],
32
            ['stream', tmpfile()],
33
            ['true', true],
34
            ['false', false],
35
            ['array', [true, 1, 2, 3, 'test']],
36
        ];
37
    }
38
}
39