X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ffactory.phpt;h=64969132757aa4be3b54f3aaddaa5e6b2cd0d76f;hb=8191c55421fb6ecc86185608a8b0510da1525e1e;hp=d80bc82ef43afaaa2cf0d5a78ab38f80114d1c4c;hpb=a4fd0a809ae831f21cbaec14e24c3d3ee0569c12;p=m6w6%2Fext-http diff --git a/tests/factory.phpt b/tests/factory.phpt index d80bc82..6496913 100644 --- a/tests/factory.phpt +++ b/tests/factory.phpt @@ -3,39 +3,44 @@ factory --SKIPIF-- --FILE-- "curl")); -$r = $f->createRequest(); +$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("Request", "Pool", "DataShare") as $type) { +foreach (array("Client", "Pool", "DataShare") as $type) { try { - var_dump((new http\Request\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,18 +50,22 @@ echo "Done\n"; ?> --EXPECTF-- Test -array(4) { +array(6) { [0]=> string(9) "MyFactory" [1]=> - string(9) "MyRequest" + string(8) "MyClient" [2]=> string(6) "MyPool" [3]=> string(7) "MyShare" + [4]=> + string(6) "MyPool" + [5]=> + string(7) "MyShare" } string(4) "curl" -requests are not supported by this driver +clients are not supported by this driver pools are not supported by this driver datashares are not supported by this driver Done