gearman_client_011.phpt 957 B

1234567891011121314151617181920212223
  1. --TEST--
  2. GearmanClient::context(), GearmanClient::setContext(), gearman_client_context(), gearman_client_set_context()
  3. --SKIPIF--
  4. <?php if (!extension_loaded("gearman")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. $client = new GearmanClient();
  8. print "GearmanClient::setContext(OO): " . ($client->setContext('context1_context1_context1_context1') ? 'Success' : 'Failure') . PHP_EOL;
  9. print "GearmanClient::context (OO): " . $client->context() . PHP_EOL;
  10. $client2 = gearman_client_create();
  11. print "gearman_client_set_context (Procedural): " . (gearman_client_set_context($client2, 'context2_context2') ? 'Success' : 'Failure') . PHP_EOL;
  12. print "gearman_client_context (Procedural): " . gearman_client_context($client2) . PHP_EOL;
  13. print "OK";
  14. ?>
  15. --EXPECT--
  16. GearmanClient::setContext(OO): Success
  17. GearmanClient::context (OO): context1_context1_context1_context1
  18. gearman_client_set_context (Procedural): Success
  19. gearman_client_context (Procedural): context2_context2
  20. OK