--TEST-- MongoDB\Driver\TopologyDescription debug output --SKIPIF-- --FILE-- topologyDescription = $event->getNewDescription(); } public function topologyClosed(MongoDB\Driver\Monitoring\TopologyClosedEvent $event): void {} public function topologyOpening(MongoDB\Driver\Monitoring\TopologyOpeningEvent $event): void {} public function getTopologyDescription() { $manager = create_test_manager(); $manager->addSubscriber($this); $manager->executeCommand(DATABASE_NAME, new MongoDB\Driver\Command(['ping' => 1])); $manager->removeSubscriber($this); return $this->topologyDescription; } } $subscriber = new TopologyDescriptionProvider; $topologyDescription = $subscriber->getTopologyDescription(); var_dump($topologyDescription); ?> ===DONE=== --EXPECTF-- object(MongoDB\Driver\TopologyDescription)#%d (%d) { ["servers"]=> array(%d) { [0]=> object(MongoDB\Driver\ServerDescription)#%d (%d) {%A }%A } ["type"]=> string(%d) "%r(Single|Sharded|ReplicaSetWithPrimary|LoadBalanced)%r" } ===DONE===