diff --git a/tests/FunctionalTestCase.php b/tests/FunctionalTestCase.php index 51c34cf3c..483823faa 100644 --- a/tests/FunctionalTestCase.php +++ b/tests/FunctionalTestCase.php @@ -334,7 +334,7 @@ protected function getFeatureCompatibilityVersion(?ReadPreference $readPreferenc $cursor = $this->manager->executeCommand( 'admin', new Command(['getParameter' => 1, 'featureCompatibilityVersion' => 1]), - $readPreference ?: new ReadPreference(ReadPreference::PRIMARY), + ['readPreference' => $readPreference ?: new ReadPreference(ReadPreference::PRIMARY)], ); $cursor->setTypeMap(['root' => 'array', 'document' => 'array']); @@ -357,7 +357,7 @@ protected function getServerVersion(?ReadPreference $readPreference = null) $buildInfo = $this->manager->executeCommand( $this->getDatabaseName(), new Command(['buildInfo' => 1]), - $readPreference ?: new ReadPreference(ReadPreference::PRIMARY), + ['readPreference' => $readPreference ?: new ReadPreference(ReadPreference::PRIMARY)], )->toArray()[0]; if (isset($buildInfo->version) && is_string($buildInfo->version)) { @@ -372,7 +372,7 @@ protected function getServerStorageEngine(?ReadPreference $readPreference = null $cursor = $this->manager->executeCommand( $this->getDatabaseName(), new Command(['serverStatus' => 1]), - $readPreference ?: new ReadPreference(ReadPreference::PRIMARY), + ['readPreference' => $readPreference ?: new ReadPreference(ReadPreference::PRIMARY)], ); $result = current($cursor->toArray()); diff --git a/tests/SpecTests/PrimaryStepDownSpecTest.php b/tests/SpecTests/PrimaryStepDownSpecTest.php index 2de6d4c44..bc060c061 100644 --- a/tests/SpecTests/PrimaryStepDownSpecTest.php +++ b/tests/SpecTests/PrimaryStepDownSpecTest.php @@ -270,7 +270,7 @@ private function getTotalConnectionsCreated(?Server $server = null) $cursor = $server->executeCommand( $this->getDatabaseName(), new Command(['serverStatus' => 1]), - new ReadPreference(ReadPreference::PRIMARY), + ['readPreference' => new ReadPreference(ReadPreference::PRIMARY)], ); $cursor->setTypeMap(['root' => 'array', 'document' => 'array']);