@@ -215,6 +215,45 @@ public function testQueryMatchLessThan(): void
215215 self ::assertEquals (['Sayings of the Century ' , 'Moby Dick ' ], $ result ->getData ());
216216 }
217217
218+ /**
219+ * $.store.books[?(@.price > 10)].title
220+ * Filter books that have a price more than 10
221+ *
222+ * @throws Exception
223+ */
224+ public function testQueryMatchMoreThan (): void
225+ {
226+ $ result = (new JSONPath ($ this ->exampleData (random_int (0 , 1 ))))->find ('$.store.books[?(@.price > 10)].title ' );
227+
228+ self ::assertEquals (['Sword of Honour ' , 'The Lord of the Rings ' ], $ result ->getData ());
229+ }
230+
231+ /**
232+ * $.store.books[?(@.price <= 12.99)].title
233+ * Filter books that have a price less or equal to 12.99
234+ *
235+ * @throws Exception
236+ */
237+ public function testQueryMatchLessOrEqual (): void
238+ {
239+ $ result = (new JSONPath ($ this ->exampleData (random_int (0 , 1 ))))->find ('$.store.books[?(@.price <= 12.99)].title ' );
240+
241+ self ::assertEquals (['Sayings of the Century ' , 'Sword of Honour ' , 'Moby Dick ' ], $ result ->getData ());
242+ }
243+
244+ /**
245+ * $.store.books[?(@.price >= 12.99)].title
246+ * Filter books that have a price less or equal to 12.99
247+ *
248+ * @throws Exception
249+ */
250+ public function testQueryMatchEqualOrMore (): void
251+ {
252+ $ result = (new JSONPath ($ this ->exampleData (random_int (0 , 1 ))))->find ('$.store.books[?(@.price >= 12.99)].title ' );
253+
254+ self ::assertEquals (['Sword of Honour ' , 'The Lord of the Rings ' ], $ result ->getData ());
255+ }
256+
218257 /**
219258 * $..books[?(@.author == "J. R. R. Tolkien")]
220259 * Filter books that have a title equal to "..."
@@ -282,13 +321,26 @@ public function testQueryMatchIn(): void
282321 *
283322 * @throws Exception
284323 */
285- public function testQueryMatchNotIn (): void
324+ public function testQueryMatchNin (): void
286325 {
287326 $ result = (new JSONPath ($ this ->exampleData (random_int (0 , 1 ))))->find ('$..books[?(@.author nin ["J. R. R. Tolkien", "Nigel Rees"])].title ' );
288327
289328 self ::assertEquals (['Sword of Honour ' , 'Moby Dick ' ], $ result ->getData ());
290329 }
291330
331+ /**
332+ * $..books[?(@.author nin ["J. R. R. Tolkien", "Nigel Rees"])]
333+ * Filter books that don't have a title in ["...", "..."]
334+ *
335+ * @throws Exception
336+ */
337+ public function testQueryMatchNotIn (): void
338+ {
339+ $ result = (new JSONPath ($ this ->exampleData (random_int (0 , 1 ))))->find ('$..books[?(@.author !in ["J. R. R. Tolkien", "Nigel Rees"])].title ' );
340+
341+ self ::assertEquals (['Sword of Honour ' , 'Moby Dick ' ], $ result ->getData ());
342+ }
343+
292344 /**
293345 * $.store.books[*].author
294346 *
0 commit comments