File tree 3 files changed +31
-1
lines changed
3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,25 @@ jobs:
54
54
composer update -n --prefer-dist
55
55
php vendor/bin/phpunit
56
56
57
+ php81 :
58
+ docker :
59
+ - image : cimg/php:8.1
60
+
61
+ working_directory : ~/project
62
+ steps :
63
+ - checkout
64
+ - run :
65
+ name : Run tests
66
+ command : |
67
+ composer update -n --prefer-dist
68
+ php vendor/bin/phpunit
69
+
57
70
workflows :
58
71
version : 2
59
72
test :
60
73
jobs :
61
74
- php72
62
75
- php73
63
76
- php74
64
- - php80
77
+ - php80
78
+ - php81
Original file line number Diff line number Diff line change @@ -671,6 +671,10 @@ public static function createFromArray(array $array): self
671
671
*/
672
672
public static function getPathByField (string $ field )
673
673
{
674
+ if ('_id ' === $ field ) {
675
+ return $ field ;
676
+ }
677
+
674
678
return in_array ($ field , ['id ' , 'type ' ])
675
679
? 'uuid. ' .$ field
676
680
: 'indexed_metadata. ' .$ field ;
Original file line number Diff line number Diff line change @@ -525,4 +525,16 @@ public function testMap()
525
525
$ this ->assertEquals (10 , $ item ->getScore ());
526
526
$ this ->assertNull ($ item ->getCoordinate ());
527
527
}
528
+
529
+ /**
530
+ * @return void
531
+ */
532
+ public function testPathByField ()
533
+ {
534
+ $ this ->assertEquals ('_id ' , Item::getPathByField ('_id ' ));
535
+ $ this ->assertEquals ('uuid.id ' , Item::getPathByField ('id ' ));
536
+ $ this ->assertEquals ('uuid.type ' , Item::getPathByField ('type ' ));
537
+ $ this ->assertEquals ('indexed_metadata.another_id ' , Item::getPathByField ('another_id ' ));
538
+ $ this ->assertEquals ('indexed_metadata._field ' , Item::getPathByField ('_field ' ));
539
+ }
528
540
}
You can’t perform that action at this time.
0 commit comments