Failed Conditions
Pull Request — develop (#3536)
by Jonathan
61:12
created

FormatVariableTest::provideDataForFormatVariable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 11
rs 9.9666
c 0
b 0
f 0
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\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
            ['[true, 1, 2, 3, "test"]', [true, 1, 2, 3, 'test']],
36
        ];
37
    }
38
}
39