|
| 1 | +<?php |
| 2 | +declare(strict_types=1); |
| 3 | + |
| 4 | +namespace Remorhaz\JSON\Path\Test\Query; |
| 5 | + |
| 6 | +use PHPUnit\Framework\TestCase; |
| 7 | +use Remorhaz\JSON\Path\Query\QueryProperties; |
| 8 | + |
| 9 | +/** |
| 10 | + * @covers \Remorhaz\JSON\Path\Query\QueryProperties |
| 11 | + */ |
| 12 | +class QueryPropertiesTest extends TestCase |
| 13 | +{ |
| 14 | + |
| 15 | + /** |
| 16 | + * @param bool $isDefinite |
| 17 | + * @param bool $expectedValue |
| 18 | + * @dataProvider providerIsDefinite |
| 19 | + */ |
| 20 | + public function testIsDefinite_ConstructedWithIsDefiniteFlag_ReturnsSameValue( |
| 21 | + bool $isDefinite, |
| 22 | + bool $expectedValue |
| 23 | + ): void { |
| 24 | + $properties = new QueryProperties($isDefinite, false); |
| 25 | + self::assertSame($expectedValue, $properties->isDefinite()); |
| 26 | + } |
| 27 | + |
| 28 | + public function providerIsDefinite(): array |
| 29 | + { |
| 30 | + return [ |
| 31 | + 'TRUE' => [true, true], |
| 32 | + 'FALSE' => [false, false], |
| 33 | + ]; |
| 34 | + } |
| 35 | + |
| 36 | + /** |
| 37 | + * @param bool $isPath |
| 38 | + * @param bool $expectedValue |
| 39 | + * @dataProvider providerIsPath |
| 40 | + */ |
| 41 | + public function testIsPath_ConstructedWithIsPathFlag_ReturnsSameValue( |
| 42 | + bool $isPath, |
| 43 | + bool $expectedValue |
| 44 | + ): void { |
| 45 | + $properties = new QueryProperties(false, $isPath); |
| 46 | + self::assertSame($expectedValue, $properties->isPath()); |
| 47 | + } |
| 48 | + |
| 49 | + public function providerIsPath(): array |
| 50 | + { |
| 51 | + return [ |
| 52 | + 'TRUE' => [true, true], |
| 53 | + 'FALSE' => [false, false], |
| 54 | + ]; |
| 55 | + } |
| 56 | +} |
0 commit comments