gearman_task_001.phpt 806 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. GearmanTask::functionName, gearman_task_function_name
  3. --SKIPIF--
  4. <?php if (!extension_loaded("gearman")) print "skip";
  5. require_once('skipifconnect.inc');
  6. ?>
  7. --FILE--
  8. <?php
  9. $client = new GearmanClient();
  10. $client->addServer('localhost', 4730);
  11. $task = $client->addTask("GearmanTaskFunction", "normal");
  12. print "GearmanTask::functionName (OO): " . $task->functionName() . PHP_EOL;
  13. $client2 = gearman_client_create();
  14. gearman_client_add_server($client2, 'localhost', 4730);
  15. $task2 = gearman_client_add_task($client2, "GearmanTaskFunction2", "normal");
  16. print "gearman_client_function_name (Procedural): "
  17. . gearman_task_function_name($task2) . PHP_EOL;
  18. print "OK";
  19. ?>
  20. --EXPECT--
  21. GearmanTask::functionName (OO): GearmanTaskFunction
  22. gearman_client_function_name (Procedural): GearmanTaskFunction2
  23. OK