gearman_client_006.phpt 1.1 KB

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