gearman_worker_006.phpt 850 B

1234567891011121314151617181920212223
  1. --TEST--
  2. gearman_worker_set_options()
  3. --SKIPIF--
  4. <?php if (!extension_loaded("gearman")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. $worker = new GearmanWorker();
  8. print "GearmanWorker::setOptions (OO): " . ($worker->setOptions(GEARMAN_WORKER_NON_BLOCKING) === true ? 'Success' : 'Failure') . PHP_EOL;
  9. print "GearmanWorker::options() (OO): " . $worker->options() . PHP_EOL;
  10. $worker2 = gearman_worker_create();
  11. print "gearman_worker_set_options (Procedural): " . (gearman_worker_set_options($worker, GEARMAN_WORKER_NON_BLOCKING) === true ? 'Success' : 'Failure') . PHP_EOL;
  12. print "gearman_worker_options() (Procedural): " . gearman_worker_options($worker) . PHP_EOL;
  13. print "OK";
  14. ?>
  15. --EXPECT--
  16. GearmanWorker::setOptions (OO): Success
  17. GearmanWorker::options() (OO): 6
  18. gearman_worker_set_options (Procedural): Success
  19. gearman_worker_options() (Procedural): 6
  20. OK