RangeTest::failingTypeDataprovider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 16
rs 9.7998
1
<?php declare(strict_types = 1);
2
3
namespace Apicart\FQL\Tests\Token\Token;
4
5
use Apicart\FQL\Token\Token\Range;
6
use InvalidArgumentException;
7
use PHPUnit\Framework\TestCase;
8
9
final class RangeTest extends TestCase
10
{
11
12
    public function failingTypeDataprovider(): array
13
    {
14
        return [
15
            ['', 'inclusive'],
16
            ['', 'exclusive'],
17
            ['inclusive', ''],
18
            ['exclusive', ''],
19
            [null, null],
20
            ['other', 'inclusive'],
21
            ['other', 'exclusive'],
22
            ['inclusive', 'other'],
23
            ['exclusive', 'other'],
24
            ['inclusive', null],
25
            ['exclusive', null],
26
            [null, 'inclusive'],
27
            [null, 'exclusive'],
28
        ];
29
    }
30
31
32
    /**
33
     * @dataProvider failingTypeDataprovider
34
     */
35
    public function testConstructorFailsWrongType(?string $startType, ?string $endType): void
36
    {
37
        $this->expectException(InvalidArgumentException::class);
38
        new Range('[a TO b]', 0, '', 'a', 'b', $startType, $endType);
39
    }
40
41
}
42