gearman_client_012.phpt 1.1 KB

12345678910111213141516171819202122232425
  1. --TEST--
  2. GearmanClient::addServer(), gearman_client_add_server()
  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. print "GearmanClient::addServer(OO), implicit port: " . ($client->addServer('localhost') ? 'Success' : 'Failure') . PHP_EOL;
  11. print "GearmanClient::addServer(OO), explicit port: " . ($client->addServer('localhost', 4730) ? 'Success' : 'Failure') . PHP_EOL;
  12. $client2 = gearman_client_create();
  13. print "gearman_client_add_server (Procedural), implicit port: " . (gearman_client_add_server($client2, 'localhost') ? 'Success' : 'Failure') . PHP_EOL;
  14. print "gearman_client_add_server (Procedural): explicit port" . (gearman_client_add_server($client2, 'localhost', 4730) ? 'Success' : 'Failure') . PHP_EOL;
  15. print "OK";
  16. ?>
  17. --EXPECT--
  18. GearmanClient::addServer(OO), implicit port: Success
  19. GearmanClient::addServer(OO), explicit port: Success
  20. gearman_client_add_server (Procedural), implicit port: Success
  21. gearman_client_add_server (Procedural): explicit portSuccess
  22. OK