--TEST-- MongoDB\Driver\TopologyDescription::hasReadableServer() (argument with bad type) --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; } } $tests = [ 1, [], ]; $subscriber = new TopologyDescriptionProvider; $topologyDescription = $subscriber->getTopologyDescription(); foreach ($tests as $test) { throws(function() use ($topologyDescription, $test) { $topologyDescription->hasReadableServer($test); }, TypeError::class); } ?> ===DONE=== --EXPECT-- OK: Got TypeError OK: Got TypeError ===DONE===