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

FormatArrayTest::testFormatArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\DBAL\Exception;
6
7
use Doctrine\DBAL\Exception\FormatArray;
8
use PHPUnit\Framework\TestCase;
9
10
class FormatArrayTest extends TestCase
11
{
12
    /**
13
     * @dataProvider provideDataForFormatArray
14
     */
15
    public function testFormatArray($expected, $array) : void
16
    {
17
        self::assertSame($expected, (new FormatArray())->__invoke($array));
18
    }
19
20
    /**
21
     * @return array<int, array<int, string|mixed[]>>
22
     */
23
    public function provideDataForFormatArray() : array
24
    {
25
        return [
26
            ['[]', []],
27
            ['[true]', [true]],
28
            ['["test"]', ['test']],
29
            ['["test1", "test2"]', ['test1', 'test2']],
30
        ];
31
    }
32
}
33