From d0675c38d1c7952b460fa6133d3ed7810f5b4e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 8 Nov 2023 16:32:05 +0100 Subject: [PATCH] PHPLIB-1305 Support "codec" option in listSearchIndexes() --- src/Operation/ListSearchIndexes.php | 2 +- tests/Operation/ListSearchIndexesTest.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Operation/ListSearchIndexes.php b/src/Operation/ListSearchIndexes.php index 875eab3af..8cf7f1e56 100644 --- a/src/Operation/ListSearchIndexes.php +++ b/src/Operation/ListSearchIndexes.php @@ -63,7 +63,7 @@ public function __construct(string $databaseName, string $collectionName, array $this->databaseName = $databaseName; $this->collectionName = $collectionName; $this->listSearchIndexesOptions = array_intersect_key($options, ['name' => 1]); - $this->aggregateOptions = array_intersect_key($options, ['batchSize' => 1, 'collation' => 1, 'comment' => 1, 'maxTimeMS' => 1, 'readConcern' => 1, 'readPreference' => 1, 'session' => 1, 'typeMap' => 1]); + $this->aggregateOptions = array_intersect_key($options, ['batchSize' => 1, 'codec' => 1, 'collation' => 1, 'comment' => 1, 'maxTimeMS' => 1, 'readConcern' => 1, 'readPreference' => 1, 'session' => 1, 'typeMap' => 1]); $this->aggregate = $this->createAggregate(); } diff --git a/tests/Operation/ListSearchIndexesTest.php b/tests/Operation/ListSearchIndexesTest.php index 65d020e68..23bc770ef 100644 --- a/tests/Operation/ListSearchIndexesTest.php +++ b/tests/Operation/ListSearchIndexesTest.php @@ -28,6 +28,8 @@ public function provideInvalidConstructorOptions(): array $options[][] = ['batchSize' => $value]; } + $options[][] = ['codec' => 'foo']; + return $options; } }