gearman_worker_007.phpt 848 B

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