File: gearman_client_010.phpt

package info (click to toggle)
php-gearman 2.0.2%2B1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 868 kB
  • ctags: 723
  • sloc: ansic: 7,092; php: 826; xml: 570; sh: 32; makefile: 1
file content (27 lines) | stat: -rw-r--r-- 1,037 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
GearmanClient::setTimeout(), gearman_client_set_timeout()
--SKIPIF--
<?php if (!extension_loaded("gearman")) print "skip"; ?>
--FILE--
<?php 

$client = new GearmanClient();
print "GearmanClient::timeout (OO): " . $client->timeout() . PHP_EOL;
print "GearmanClient::setTimeout (OO): " . ($client->setTimeout(3) ? 'Success' : 'Failure') . PHP_EOL;
print "GearmanClient::timeout (OO): " . $client->timeout() . PHP_EOL;

$client2 = gearman_client_create();
print "gearman_client_timeout (Procedural): " . gearman_client_timeout($client2) . PHP_EOL;
print "gearman_client_set_timeout (Procedural): " . (gearman_client_set_timeout($client2, 3) ? 'Success' : 'Failure') . PHP_EOL;
print "gearman_client_timeout (Procedural): " . gearman_client_timeout($client2) . PHP_EOL;

print "OK";
?>
--EXPECT--
GearmanClient::timeout (OO): -1
GearmanClient::setTimeout (OO): Success
GearmanClient::timeout (OO): 3
gearman_client_timeout (Procedural): -1
gearman_client_set_timeout (Procedural): Success
gearman_client_timeout (Procedural): 3
OK