gearman_job_002.phpt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. GearmanJob::returnCode(), gearman_job_return_code(),
  3. GearmanJob::setReturn(), gearman_job_set_return()
  4. --SKIPIF--
  5. <?php if (!extension_loaded("gearman")) print "skip"; ?>
  6. --FILE--
  7. <?php
  8. $job = new GearmanJob();
  9. print "GearmanJob::returnCode (OO): " . $job->returnCode() . PHP_EOL;
  10. print "GearmanJob::setReturn with value GEARMAN_TIMEOUT (OO): "
  11. . ($job->setReturn(GEARMAN_TIMEOUT) ? 'Success' : 'Failure')
  12. . PHP_EOL;
  13. print "GearmanJob::returnCode matches GEARMAN_TIMEOUT (OO): "
  14. . ($job->returnCode() == GEARMAN_TIMEOUT ? 'Success' : 'Failure') . PHP_EOL;
  15. $job2 = new GearmanJob();
  16. print "gearman_job_return_code (Procedural): " . gearman_job_return_code($job2) . PHP_EOL;
  17. print "gearman_job_set_return with value GEARMAN_TIMEOUT (Procedural): "
  18. . (gearman_job_set_return($job2, GEARMAN_TIMEOUT) ? 'Success' : 'Failure')
  19. . PHP_EOL;
  20. print "gearman_job_return_code matches GEARMAN_TIMEOUT (OO): "
  21. . (gearman_job_return_code($job2) == GEARMAN_TIMEOUT ? 'Success' : 'Failure') . PHP_EOL;
  22. print "OK";
  23. ?>
  24. --EXPECT--
  25. GearmanJob::returnCode (OO): 0
  26. GearmanJob::setReturn with value GEARMAN_TIMEOUT (OO): Success
  27. GearmanJob::returnCode matches GEARMAN_TIMEOUT (OO): Success
  28. gearman_job_return_code (Procedural): 0
  29. gearman_job_set_return with value GEARMAN_TIMEOUT (Procedural): Success
  30. gearman_job_return_code matches GEARMAN_TIMEOUT (OO): Success
  31. OK