gearman_client_019.phpt 673 B

123456789101112131415161718192021222324
  1. --TEST--
  2. GearmanClient::ping(), gearman_client_ping()
  3. --SKIPIF--
  4. <?php if (!extension_loaded("gearman")) print "skip";
  5. require_once('skipifconnect.inc');
  6. ?>
  7. --FILE--
  8. <?php
  9. $client = new GearmanClient();
  10. $client->addServer('localhost', 4730);
  11. print "GearmanClient::ping (OO): " . ($client->ping('oo data') ? 'Success' : 'Failure') . PHP_EOL;
  12. $client2 = gearman_client_create();
  13. gearman_client_add_server($client2, 'localhost', 4730);
  14. print "gearman_client_ping (Procedural): "
  15. . (gearman_client_ping($client2,'procedural data') ? 'Success' : 'Failure') . PHP_EOL;
  16. print "OK";
  17. ?>
  18. --EXPECT--
  19. GearmanClient::ping (OO): Success
  20. gearman_client_ping (Procedural): Success
  21. OK