forked from SoftCreatR/JSONPath
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSONPathTest.php
More file actions
820 lines (670 loc) · 22.8 KB
/
JSONPathTest.php
File metadata and controls
820 lines (670 loc) · 22.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
<?php
/**
* JSONPath implementation for PHP.
*
* @license https://github.com/SoftCreatR/JSONPath/blob/main/LICENSE MIT License
*/
declare(strict_types=1);
namespace Flow\JSONPath\Test;
use Flow\JSONPath\JSONPath;
use Flow\JSONPath\JSONPathException;
use Flow\JSONPath\Test\Traits\TestDataTrait;
use JsonException;
use PHPUnit\Framework\TestCase;
use const JSON_THROW_ON_ERROR;
class JSONPathTest extends TestCase
{
use TestDataTrait;
/**
* $.store.books[0].title
*
* @throws JSONPathException|JsonException
*/
public function testChildOperators(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$.store.books[0].title');
self::assertEquals('Sayings of the Century', $result[0]);
}
/**
* @throws JSONPathException|JsonException
*/
public function testIndexesObject(): void
{
$result = (new JSONPath($this->getData('indexed-object')))
->find('$.store.books[3].title');
self::assertEquals('Sword of Honour', $result[0]);
}
/**
* $['store']['books'][0]['title']
*
* @throws JSONPathException|JsonException
*/
public function testChildOperatorsAlt(): void
{
$result = (new JSONPath($this->getData('example')))
->find("$['store']['books'][0]['title']");
self::assertEquals('Sayings of the Century', $result[0]);
}
/**
* $.array[start:end:step]
*
* @throws JSONPathException|JsonException
*/
public function testFilterSliceA(): void
{
// Copy all items... similar to a wildcard
$result = (new JSONPath($this->getData('example')))
->find("$['store']['books'][:].title");
self::assertEquals(
['Sayings of the Century', 'Sword of Honour', 'Moby Dick', 'The Lord of the Rings'],
$result->getData()
);
}
/**
* Positive end indexes
* $[0:2]
*
* @throws JSONPathException
*/
public function testFilterSlicePositiveEndIndexes(): void
{
$jsonPath = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']));
$result = $jsonPath
->find('$[0:0]');
self::assertEquals([], $result->getData());
$result = $jsonPath
->find('$[0:1]');
self::assertEquals(['first'], $result->getData());
$result = $jsonPath
->find('$[0:2]');
self::assertEquals(['first', 'second'], $result->getData());
$result = $jsonPath
->find('$[:2]');
self::assertEquals(['first', 'second'], $result->getData());
$result = $jsonPath
->find('$[1:2]');
self::assertEquals(['second'], $result->getData());
$result = $jsonPath
->find('$[0:3:1]');
self::assertEquals(['first', 'second', 'third'], $result->getData());
$result = $jsonPath
->find('$[0:3:0]');
self::assertEquals(['first', 'second', 'third'], $result->getData());
}
/**
* @throws JSONPathException
*/
public function testFilterSliceNegativeStartIndexes(): void
{
$result = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']))
->find('$[-2:]');
self::assertEquals(['fourth', 'fifth'], $result->getData());
$result = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']))
->find('$[-1:]');
self::assertEquals(['fifth'], $result->getData());
$result = (new JSONPath(['first', 'second', 'third']))
->find('$[-4:]');
self::assertEquals(['first', 'second', 'third'], $result->getData());
}
/**
* Negative end indexes
* $[:-2]
*
* @throws JSONPathException
*/
public function testFilterSliceNegativeEndIndexes(): void
{
$jsonPath = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']));
$result = $jsonPath
->find('$[:-2]');
self::assertEquals(['first', 'second', 'third'], $result->getData());
$result = $jsonPath
->find('$[0:-2]');
self::assertEquals(['first', 'second', 'third'], $result->getData());
}
/**
* Negative end indexes
* $[:-2]
*
* @throws JSONPathException
*/
public function testFilterSliceNegativeStartAndEndIndexes(): void
{
$jsonPath = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']));
$result = $jsonPath
->find('$[-2:-1]');
self::assertEquals(['fourth'], $result->getData());
$result = $jsonPath
->find('$[-4:-2]');
self::assertEquals(['second', 'third'], $result->getData());
}
/**
* Negative end indexes
* $[:-2]
*
* @throws JSONPathException
*/
public function testFilterSliceNegativeStartAndPositiveEnd(): void
{
$result = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']))
->find('$[-2:2]');
self::assertEquals([], $result->getData());
}
/**
* @throws JSONPathException
*/
public function testFilterSliceStepBy2(): void
{
$result = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']))
->find('$[0:4:2]');
self::assertEquals(['first', 'third'], $result->getData());
}
/**
* The Last item
* $[-1]
*
* @throws JSONPathException
*/
public function testFilterLastIndex(): void
{
$result = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']))
->find('$[-1]');
self::assertEquals(['fifth'], $result->getData());
}
/**
* Array index slice only end
* $[:2]
*
* @throws JSONPathException
*/
public function testFilterSliceG(): void
{
// Fetch up to the second index
$result = (new JSONPath(['first', 'second', 'third', 'fourth', 'fifth']))
->find('$[:2]');
self::assertEquals(['first', 'second'], $result->getData());
}
/**
* $.store.books[(@.length-1)].title
*
* This notation is only partially implemented eg. hacked in
*
* @throws JSONPathException|JsonException
*/
public function testChildQuery(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$.store.books[(@.length-1)].title');
self::assertEquals(['The Lord of the Rings'], $result->getData());
}
/**
* $.store.books[?(@.price < 10)].title
* Filter books that have a price less than 10
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchLessThan(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$.store.books[?(@.price < 10)].title');
self::assertEquals(['Sayings of the Century', 'Moby Dick'], $result->getData());
}
/**
* $.store.books[?(@.price > 10)].title
* Filter books that have a price more than 10
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchMoreThan(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$.store.books[?(@.price > 10)].title');
self::assertEquals(['Sword of Honour', 'The Lord of the Rings'], $result->getData());
}
/**
* $.store.books[?(@.price <= 12.99)].title
* Filter books that have a price less or equal to 12.99
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchLessOrEqual(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$.store.books[?(@.price <= 12.99)].title');
self::assertEquals(['Sayings of the Century', 'Sword of Honour', 'Moby Dick'], $result->getData());
}
/**
* $.store.books[?(@.price >= 12.99)].title
* Filter books that have a price less or equal to 12.99
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchEqualOrMore(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$.store.books[?(@.price >= 12.99)].title');
self::assertEquals(['Sword of Honour', 'The Lord of the Rings'], $result->getData());
}
/**
* $..books[?(@.author == "J. R. R. Tolkien")]
* Filter books that have an author equal to "..."
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchEquals(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..books[?(@.author == "J. R. R. Tolkien")].title');
self::assertEquals('The Lord of the Rings', $result[0]);
}
/**
* $..books[?(@.author = 1)]
* Filter books that have a title equal to "..."
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchEqualsWithUnquotedInteger(): void
{
$results = (new JSONPath($this->getData('simple-integers')))
->find('$..features[?(@.value = 1)]');
self::assertEquals('foo', $results[0]->name);
self::assertEquals('baz', $results[1]->name);
}
/**
* $..books[?(@.author != "J. R. R. Tolkien")]
* Filter books that have an author not equal to "..."
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchNotEqualsTo(): void
{
$jsonPath = (new JSONPath($this->getData('example')));
$results = $jsonPath
->find('$..books[?(@.author != "J. R. R. Tolkien")].title');
self::assertcount(3, $results);
self::assertEquals(['Sayings of the Century', 'Sword of Honour', 'Moby Dick'], $results->getData());
$results = $jsonPath
->find('$..books[?(@.author !== "J. R. R. Tolkien")].title');
self::assertcount(3, $results);
self::assertEquals(['Sayings of the Century', 'Sword of Honour', 'Moby Dick'], $results->getData());
$results = $jsonPath
->find('$..books[?(@.author <> "J. R. R. Tolkien")].title');
self::assertcount(3, $results);
self::assertEquals(['Sayings of the Century', 'Sword of Honour', 'Moby Dick'], $results->getData());
}
/**
* $..books[?(@.author =~ /nigel ree?s/i)]
* Filter books where author matches regex
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchWithRegexCaseSensitive(): void
{
$jsonPath = (new JSONPath($this->getData('example')));
$results = $jsonPath
->find('$..books[?(@.author =~ /nigel ree?s/i)].title');
self::assertcount(1, $results);
self::assertEquals(['Sayings of the Century'], $results->getData());
$results = $jsonPath
->find('$..books[?(@.title =~ /^(Say|The).*/)].title');
self::assertcount(2, $results);
self::assertEquals(['Sayings of the Century', 'The Lord of the Rings'], $results->getData());
}
/**
* $..books[?(@.author =~ "J. R. R. Tolkien")]
* Filter books where author matches invalid regex
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchWithInvalidRegex(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..books[?(@.author =~ "J. R. R. Tolkien")].title');
self::assertEmpty($result->getData());
}
/**
* $..books[?(@.author in ["J. R. R. Tolkien", "Nigel Rees"])]
* Filter books that have a title in ["...", "..."]
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchIn(): void
{
$results = (new JSONPath($this->getData('example')))
->find('$..books[?(@.author in ["J. R. R. Tolkien", "Nigel Rees"])].title');
self::assertEquals(['Sayings of the Century', 'The Lord of the Rings'], $results->getData());
}
/**
* $..books[?(@.author nin ["J. R. R. Tolkien", "Nigel Rees"])]
* Filter books that don't have a title in ["...", "..."]
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchNin(): void
{
$results = (new JSONPath($this->getData('example')))
->find('$..books[?(@.author nin ["J. R. R. Tolkien", "Nigel Rees"])].title');
self::assertEquals(['Sword of Honour', 'Moby Dick'], $results->getData());
}
/**
* $..books[?(@.author nin ["J. R. R. Tolkien", "Nigel Rees"])]
* Filter books that don't have a title in ["...", "..."]
*
* @throws JSONPathException|JsonException
*/
public function testQueryMatchNotIn(): void
{
$results = (new JSONPath($this->getData('example')))
->find('$..books[?(@.author !in ["J. R. R. Tolkien", "Nigel Rees"])].title');
self::assertEquals(['Sword of Honour', 'Moby Dick'], $results->getData());
}
/**
* $.store.books[*].author
*
* @throws JSONPathException|JsonException
*/
public function testWildcardAltNotation(): void
{
$results = (new JSONPath($this->getData('example')))
->find('$.store.books[*].author');
self::assertEquals(['Nigel Rees', 'Evelyn Waugh', 'Herman Melville', 'J. R. R. Tolkien'], $results->getData());
}
/**
* $..author
*
* @throws JSONPathException|JsonException
*/
public function testRecursiveChildSearch(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..author');
self::assertEquals(['Nigel Rees', 'Evelyn Waugh', 'Herman Melville', 'J. R. R. Tolkien'], $result->getData());
}
/**
* $.store.*
* all things in store
* the structure of the example data makes this test look weird
*
* @throws JSONPathException|JsonException
*/
public function testWildCard(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$.store.*');
if (\is_object($result[0][0])) {
self::assertEquals('Sayings of the Century', $result[0][0]->title);
} else {
self::assertEquals('Sayings of the Century', $result[0][0]['title']);
}
if (\is_object($result[1])) {
self::assertEquals('red', $result[1]->color);
} else {
self::assertEquals('red', $result[1]['color']);
}
}
/**
* $.store..price
* the price of everything in the store.
*
* @throws JSONPathException|JsonException
*/
public function testRecursiveChildSearchAlt(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$.store..price');
self::assertEquals([8.95, 12.99, 8.99, 22.99, 19.95], $result->getData());
}
/**
* $..books[2]
* the third book
*
* @throws JSONPathException|JsonException
*/
public function testRecursiveChildSearchWithChildIndex(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..books[2].title');
self::assertEquals(['Moby Dick'], $result->getData());
}
/**
* $..books[(@.length-1)]
*
* @throws JSONPathException|JsonException
*/
public function testRecursiveChildSearchWithChildQuery(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..books[(@.length-1)].title');
self::assertEquals(['The Lord of the Rings'], $result->getData());
}
/**
* $..books[-1:]
* Return the last results
*
* @throws JSONPathException|JsonException
*/
public function testRecursiveChildSearchWithSliceFilter(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..books[-1:].title');
self::assertEquals(['The Lord of the Rings'], $result->getData());
}
/**
* $..books[?(@.isbn)]
* filter all books with isbn number
*
* @throws JSONPathException|JsonException
*/
public function testRecursiveWithQueryMatch(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..books[?(@.isbn)].isbn');
self::assertEquals(['0-553-21311-3', '0-395-19395-8'], $result->getData());
}
/**
* .data.tokens[?(@.Employee.FirstName)]
* Verify that it is possible to filter with a key containing punctuation
*
* @throws JSONPathException|JsonException
*/
public function testRecursiveWithQueryMatchWithDots(): void
{
$result = (new JSONPath($this->getData('with-dots')))
->find(".data.tokens[?(@.Employee.FirstName)]");
$result = \json_decode(
\json_encode($result, JSON_THROW_ON_ERROR),
true,
512,
JSON_THROW_ON_ERROR
);
self::assertEquals([['Employee.FirstName' => 'Jack']], $result);
}
/**
* $..*
* All members of JSON structure
*
* @throws JSONPathException|JsonException
*/
public function testRecursiveWithWildcard(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..*');
$result = \json_decode(
\json_encode($result, JSON_THROW_ON_ERROR),
true,
512,
JSON_THROW_ON_ERROR
);
self::assertEquals('Sayings of the Century', $result[0]['books'][0]['title']);
self::assertEquals(19.95, $result[27]);
}
/**
* Tests direct key access.
*
* @throws JSONPathException
*/
public function testSimpleArrayAccess(): void
{
$result = (new JSONPath(['title' => 'test title']))
->find('title');
self::assertEquals(['test title'], $result->getData());
}
/**
* @throws JSONPathException
*/
public function testFilteringOnNoneArrays(): void
{
$result = (new JSONPath(['foo' => 'asdf']))
->find('$.foo.bar');
self::assertEquals([], $result->getData());
}
/**
* @throws JSONPathException
*/
public function testMagicMethods(): void
{
$fooClass = new JSONPathTestClass();
$results = (new JSONPath($fooClass, JSONPath::ALLOW_MAGIC))->find('$.foo');
self::assertEquals(['bar'], $results->getData());
}
/**
* @throws JSONPathException|JsonException
*/
public function testMatchWithComplexSquareBrackets(): void
{
$result = (new JSONPath($this->getData('extra')))
->find("$['http://www.w3.org/2000/01/rdf-schema#label'][?(@['@language']='en')]['@language']");
self::assertEquals(["en"], $result->getData());
}
/**
* @throws JSONPathException|JsonException
*/
public function testQueryMatchWithRecursive(): void
{
$result = (new JSONPath($this->getData('locations')))
->find("..[?(@.type == 'suburb')].name");
self::assertEquals(["Rosebank"], $result->getData());
}
/**
* @throws JSONPathException|JsonException
*/
public function testFirst(): void
{
$result = (new JSONPath($this->getData('extra')))
->find("$['http://www.w3.org/2000/01/rdf-schema#label'].*");
self::assertEquals(["@language" => "en"], $result->first()->getData());
}
/**
* @throws JSONPathException|JsonException
*/
public function testLast(): void
{
$result = (new JSONPath($this->getData('extra')))
->find("$['http://www.w3.org/2000/01/rdf-schema#label'].*");
self::assertEquals(["@language" => "de"], $result->last()->getData());
}
/**
* @throws JSONPathException|JsonException
*/
public function testSlashesInIndex(): void
{
$result = (new JSONPath($this->getData('with-slashes')))
->find("$['mediatypes']['image/png']");
self::assertEquals(["/core/img/filetypes/image.png"], $result->getData());
}
/**
* @throws JSONPathException
*/
public function testUnionWithKeys(): void
{
$result = (new JSONPath(
[
"key" => "value",
"another" => "entry",
]
))->find("$['key','another']");
self::assertEquals(["value", "entry"], $result->getData());
}
/**
* @throws JSONPathException
*/
public function testCyrillicText(): void
{
$jsonPath = (new JSONPath(["трололо" => 1]));
$result = $jsonPath
->find("$['трололо']");
self::assertEquals([1], $result->getData());
$result = $jsonPath
->find("$.трололо");
self::assertEquals([1], $result->getData());
}
public function testOffsetUnset(): void
{
$jsonIterator = new JSONPath(
[
"route" => [
["name" => "A", "type" => "type of A"],
["name" => "B", "type" => "type of B"],
],
]
);
/** @var JSONPath $route */
$route = $jsonIterator->offsetGet('route');
$route->offsetUnset(0);
$first = $route->first();
self::assertEquals("B", $first['name']);
}
public function testFirstKey(): void
{
// Array test for array
$firstKey = (new JSONPath(['a' => 'A', 'b', 'B']))->firstKey();
self::assertEquals('a', $firstKey);
// Array test for object
$firstKey = (new JSONPath((object)['a' => 'A', 'b', 'B']))->firstKey();
self::assertEquals('a', $firstKey);
}
public function testLastKey(): void
{
// Array test for array
$lastKey = (new JSONPath(['a' => 'A', 'b' => 'B', 'c' => 'C']))->lastKey();
self::assertEquals('c', $lastKey);
// Array test for object
$lastKey = (new JSONPath((object)['a' => 'A', 'b' => 'B', 'c' => 'C']))->lastKey();
self::assertEquals('c', $lastKey);
}
/**
* Test: ensure trailing comma is stripped during parsing
*
* @throws JSONPathException|JsonException
*/
public function testTrailingComma(): void
{
$result = (new JSONPath($this->getData('example')))
->find("$..books[0,1,2,]");
self::assertCount(3, $result);
}
/**
* Test: ensure negative indexes return -n from last index
*
* @throws JSONPathException|JsonException
*/
public function testNegativeIndex(): void
{
$result = (new JSONPath($this->getData('example')))
->find('$..books[-2]');
self::assertEquals("Herman Melville", $result[0]['author']);
}
/**
* @throws JSONPathException|JsonException
*/
public function testQueryAccessWithNumericalIndexes(): void
{
$result = (new JSONPath($this->getData('numerical-indexes-object')))
->find("$.result.list[?(@.o == \"11.51000\")]");
self::assertEquals("11.51000", $result[0]->o);
$result = (new JSONPath($this->getData('numerical-indexes-array')))
->find("$.result.list[?(@[1] == \"11.51000\")]");
self::assertEquals("11.51000", $result[0][1]);
}
}