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

FormatArrayTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFormatArray() 0 3 1
A provideDataForFormatArray() 0 7 1
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