gearman_client_015.phpt 929 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. GearmanClient::doJobHandle(), gearman_client_do_job_handle()
  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. $job_handle = $client->doBackground("test_doJobHandle", "test_doJobHandle");
  12. print "GearmanClient::doJobHandle() (OO): "
  13. . ($job_handle == $client->doJobHandle() ? 'Success' : 'Failure') . PHP_EOL;
  14. $client2 = gearman_client_create();
  15. gearman_client_add_server($client2, 'localhost', 4730);
  16. $job_handle = gearman_client_do_background($client2, "test_do_job_handle", "test_do_job_handle");
  17. print "gearman_client_do_job_handle() (Procedural): "
  18. . ($job_handle == gearman_client_do_job_handle($client2) ? 'Success' : 'Failure') . PHP_EOL;
  19. print "OK";
  20. ?>
  21. --EXPECT--
  22. GearmanClient::doJobHandle() (OO): Success
  23. gearman_client_do_job_handle() (Procedural): Success
  24. OK