This repository was archived by the owner on Jun 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,25 @@ jobs:
5454 composer update -n --prefer-dist
5555 php vendor/bin/phpunit
5656
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+
5770workflows :
5871 version : 2
5972 test :
6073 jobs :
6174 - php72
6275 - php73
6376 - 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
671671 */
672672 public static function getPathByField (string $ field )
673673 {
674+ if ('_id ' === $ field ) {
675+ return $ field ;
676+ }
677+
674678 return in_array ($ field , ['id ' , 'type ' ])
675679 ? 'uuid. ' .$ field
676680 : 'indexed_metadata. ' .$ field ;
Original file line number Diff line number Diff line change @@ -525,4 +525,16 @@ public function testMap()
525525 $ this ->assertEquals (10 , $ item ->getScore ());
526526 $ this ->assertNull ($ item ->getCoordinate ());
527527 }
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+ }
528540}
You can’t perform that action at this time.
0 commit comments