gearman_client_010.phpt 1.0 KB

123456789101112131415161718192021222324252627
  1. --TEST--
  2. GearmanClient::setTimeout(), gearman_client_set_timeout()
  3. --SKIPIF--
  4. <?php if (!extension_loaded("gearman")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. $client = new GearmanClient();
  8. print "GearmanClient::timeout (OO): " . $client->timeout() . PHP_EOL;
  9. print "GearmanClient::setTimeout (OO): " . ($client->setTimeout(3) ? 'Success' : 'Failure') . PHP_EOL;
  10. print "GearmanClient::timeout (OO): " . $client->timeout() . PHP_EOL;
  11. $client2 = gearman_client_create();
  12. print "gearman_client_timeout (Procedural): " . gearman_client_timeout($client2) . PHP_EOL;
  13. print "gearman_client_set_timeout (Procedural): " . (gearman_client_set_timeout($client2, 3) ? 'Success' : 'Failure') . PHP_EOL;
  14. print "gearman_client_timeout (Procedural): " . gearman_client_timeout($client2) . PHP_EOL;
  15. print "OK";
  16. ?>
  17. --EXPECT--
  18. GearmanClient::timeout (OO): -1
  19. GearmanClient::setTimeout (OO): Success
  20. GearmanClient::timeout (OO): 3
  21. gearman_client_timeout (Procedural): -1
  22. gearman_client_set_timeout (Procedural): Success
  23. gearman_client_timeout (Procedural): 3
  24. OK