File manager - Edit - /opt/cpanel/ea-php74/root/usr/share/tests/pecl/mongodb/tests/apm/commandStartedEvent-getServer-001.phpt
Back
--TEST-- MongoDB\Driver\Monitoring\CommandStartedEvent::getServer() --SKIPIF-- <?php require __DIR__ . "/../utils/basic-skipif.inc"; ?> <?php skip_if_not_live(); ?> <?php skip_if_not_clean(); ?> --FILE-- <?php require_once __DIR__ . "/../utils/basic.inc"; class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber { public function commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void { var_dump($event->getServer()); } public function commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void { } public function commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void { } } $manager = create_test_manager(); $subscriber = new MySubscriber(); MongoDB\Driver\Monitoring\addSubscriber($subscriber); $command = new MongoDB\Driver\Command(['ping' => 1]); $manager->executeCommand('admin', $command); ?> --EXPECTF-- Deprecated: %r(Function|Method)%r MongoDB\Driver\Monitoring\CommandStartedEvent::getServer() is deprecated in %s object(MongoDB\Driver\Server)#%d (%d) { %A }
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings