X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ffactory.phpt;h=64969132757aa4be3b54f3aaddaa5e6b2cd0d76f;hb=5946b5b8a86f299bb3b37e3a60d9173ad655b3f9;hp=4267e3650308c63fa0e5623aa97ee5e6630f7a56;hpb=efdbb46bf78df0d34936c536bd78b05abadd3a0d;p=m6w6%2Fext-http diff --git a/tests/factory.phpt b/tests/factory.phpt index 4267e36..6496913 100644 --- a/tests/factory.phpt +++ b/tests/factory.phpt @@ -28,14 +28,19 @@ $r = $f->createClient(); $p = $f->createPool(); $s = $f->createDataShare(); +$r->setRequest(new http\Client\Request("GET", "http://localhost/")); +$x = $f->createPool($r); +$y = $f->createDatashare($r); + var_dump( - array_map("get_class", array($f,$r,$p,$s)), + array_map("get_class", array($f,$r,$p,$s,$x,$y)), $f->getDriver() ); foreach (array("Client", "Pool", "DataShare") as $type) { try { - var_dump((new http\Client\Factory(array("driver" => "nonexistant")))->{"create$type"}()); + $f = new http\Client\Factory(array("driver" => "nonexistant")); + var_dump($f->{"create$type"}()); } catch (Exception $e) { echo $e->getMessage(), "\n"; } @@ -45,7 +50,7 @@ echo "Done\n"; ?> --EXPECTF-- Test -array(4) { +array(6) { [0]=> string(9) "MyFactory" [1]=> @@ -54,6 +59,10 @@ array(4) { string(6) "MyPool" [3]=> string(7) "MyShare" + [4]=> + string(6) "MyPool" + [5]=> + string(7) "MyShare" } string(4) "curl" clients are not supported by this driver