Skip to content

Commit 56c8ed3

Browse files
committed
fix: pass newer compliance tests
1 parent 6709e42 commit 56c8ed3

4 files changed

Lines changed: 3 additions & 6 deletions

File tree

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _An implementation of RFC 9535 [JSONPath](http://goessner.net/articles/JsonPath/
1414

1515
This is a PHP implementation of JSONPath, a query language for JSON. It aims for 100% compatibilty with the JSONPath syntax standardized in [RFC 9535](https://datatracker.ietf.org/doc/rfc9535/).
1616

17-
Currently, this library passes 99% of the work-in-progress [JSONPath Compliance Test Suite](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite) (with the test suite version on [Jan 14, 2025](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite/tree/9277705cda4489c3d0d984831e7656e48145399b)). All of the the missing 1% are UTF-16 related tests, which should not affect most day-to-day users (and which I'm not sure how to implement in PHP — any help is appreciated!)
17+
Currently, this library passes 99% of the work-in-progress [JSONPath Compliance Test Suite](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite) (with the test suite version on [Feb 21, 2025](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite/tree/9cf4a7517828d4f18557959682a4767de4735f94)). All of the the missing 1% are UTF-16 related tests, which should not affect most day-to-day users (and which I'm not sure how to implement in PHP — any help is appreciated!)
1818

1919
## Installation
2020

src/parsers/filter-selector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function apply_query($query, $root_node, $json)
138138
case 'CurrentNode':
139139
return sizeof(apply_current_node($query, $root_node, [$json])) > 0;
140140
case 'Root':
141-
return sizeof(apply_root($query, $json)) > 0;
141+
return sizeof(apply_root($query, $root_node)) > 0;
142142
}
143143

144144
return false;

tests/RFC9535/JsonPathComplianceTestSuiteTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
'Skip UTF-16 related tests',
3232
'name selector, double quotes, supplementary plane character' =>
3333
'Skip UTF-16 related tests',
34-
35-
'filter, absolute existence, with segments' =>
36-
'Not currently supported in jsonpath-js, waiting for upstream fix',
3734
];
3835

3936
foreach ($cts->tests as $index => $test_case) {

0 commit comments

Comments
 (0)