Total Complexity | 3 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 88.89% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
15 | class ValuePathParserTest extends TestCase |
||
16 | { |
||
17 | /** |
||
18 | * @dataProvider provideValuePathTestData |
||
19 | * @param string $pathExpression |
||
20 | * @param int $expectedLength |
||
21 | */ |
||
22 | 3 | public function testTypePath(string $pathExpression, int $expectedLength): void |
|
23 | { |
||
24 | 3 | $typePath = ValuePathParser::create()->parse($pathExpression); |
|
25 | |||
26 | 3 | $this->assertCount($expectedLength, $typePath); |
|
27 | 3 | $this->assertEquals($pathExpression, $typePath->__toString()); |
|
28 | 3 | } |
|
29 | |||
30 | 1 | public function testInvalidPath(): void |
|
31 | { |
||
32 | 1 | $this->expectException(InvalidArgumentException::class); |
|
33 | 1 | ValuePathParser::create()->parse('2-teasers'); |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @codeCoverageIgnore |
||
38 | * @return mixed[] |
||
39 | */ |
||
40 | public function provideValuePathTestData(): array |
||
54 | ] |
||
55 | ]; |
||
56 | } |
||
58 |