| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php declare(strict_types = 1); |
||
| 12 | public function testParse(): void |
||
| 13 | { |
||
| 14 | $fql = 'q:"samsung" AND introducedAt:["2019-01-01 00:00:00" TO "2019-01-31 23:59:59"]' |
||
| 15 | . ' AND NOT type:(tv OR "mobile phone") OR (price:{"10" TO *] OR price:{"30" TO *])'; |
||
| 16 | $resolver = new ItemFilterResolver; |
||
| 17 | |||
| 18 | $sql = FilterParser::parse($fql, $resolver); |
||
| 19 | self::assertSame( |
||
| 20 | "name ILIKE '%samsung%'" |
||
| 21 | . " AND (introduced_at >= '2019-01-01T00:00:00+00:00' AND introduced_at <= '2019-01-31T23:59:59+00:00')" |
||
| 22 | . " AND NOT ((type = 'tv' OR type = 'mobile phone')) OR ((price > 10) OR (price > 30))", |
||
| 23 | $sql |
||
| 24 | ); |
||
| 28 |