X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fclient028.phpt;h=b0550df01b27ba96cf33edeafa06a0d91dd1cf09;hp=4678bcca8b3f4069b7c7a1861e9dc46d3aed00f4;hb=a781e1173974f92770c9fbdc6d47e0bf098cfc3f;hpb=55d74c2d07edcf6d51fe62bc257c3bde0f7f25d4 diff --git a/tests/client028.phpt b/tests/client028.phpt index 4678bcc..b0550df 100644 --- a/tests/client028.phpt +++ b/tests/client028.phpt @@ -13,28 +13,28 @@ class UserHandler implements http\Client\Curl\User { private $client; private $run; - private $fds = [ - "R" => [], - "W" => [] - ]; - private $R = []; - private $W = []; + private $fds = array( + "R" => array(), + "W" => array() + ); + private $R = array(); + private $W = array(); private $timeout = 1000; function __construct(http\Client $client) { $this->client = $client; } - function init(callable $run) { + function init($run) { $this->run = $run; } - function timer($timeout_ms) { + function timer(int $timeout_ms) { echo "T"; $this->timeout = $timeout_ms; } - function socket($socket, $action) { + function socket($socket, int $action) { echo "S"; switch ($action) { @@ -80,7 +80,7 @@ class UserHandler implements http\Client\Curl\User return count($this->client); } - function wait($timeout_ms = null) { + function wait(int $timeout_ms = null) { echo "W"; if ($timeout_ms === null) { @@ -124,9 +124,9 @@ include "helper/server.inc"; server("proxy.inc", function($port) { $client = new http\Client; - $client->configure([ + $client->configure(array( "use_eventloop" => new UserHandler($client) - ]); + )); $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/"), function($r) { var_dump($r->getResponseCode()); }); @@ -137,5 +137,5 @@ server("proxy.inc", function($port) { ===DONE=== --EXPECTREGEX-- Test -T[WST]*(O[WST]*)+U+int\(200\) +[ST][WST]*([OWST]*)+U+int\(200\) ===DONE===