Commit 9b17007f authored by Jeremy Mikola's avatar Jeremy Mikola

Support ReadPreference in getFeatureCompatibilityVersion()

parent 38f7811f
...@@ -77,14 +77,16 @@ abstract class FunctionalTestCase extends TestCase ...@@ -77,14 +77,16 @@ abstract class FunctionalTestCase extends TestCase
); );
} }
protected function getFeatureCompatibilityVersion() protected function getFeatureCompatibilityVersion(ReadPreference $readPreference = null)
{ {
if (version_compare($this->getServerVersion(), '3.4.0', '<')) { if (version_compare($this->getServerVersion(), '3.4.0', '<')) {
return $this->getServerVersion(); return $this->getServerVersion($readPreference);
} }
$cursor = $this->manager->executeCommand( $cursor = $this->manager->executeCommand(
"admin", 'admin',
new Command(['getParameter' => 1, 'featureCompatibilityVersion' => 1]) new Command(['getParameter' => 1, 'featureCompatibilityVersion' => 1]),
$readPreference ?: new ReadPreference(ReadPreference::RP_PRIMARY)
); );
$cursor->setTypeMap(['root' => 'array', 'document' => 'array']); $cursor->setTypeMap(['root' => 'array', 'document' => 'array']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment