projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix curl_multi with libevent2
[m6w6/ext-http]
/
tests
/
factory.phpt
diff --git
a/tests/factory.phpt
b/tests/factory.phpt
index d80bc82ef43afaaa2cf0d5a78ab38f80114d1c4c..6a629768102506962d894628880f0862f436d554 100644
(file)
--- a/
tests/factory.phpt
+++ b/
tests/factory.phpt
@@
-3,39
+3,43
@@
factory
--SKIPIF--
<?php
include "skipif.inc";
--SKIPIF--
<?php
include "skipif.inc";
-in_array("curl", http\
Reques
t\Factory::getAvailableDrivers()) or die ("skip CURL support missing");
+in_array("curl", http\
Clien
t\Factory::getAvailableDrivers()) or die ("skip CURL support missing");
?>
--FILE--
<?php
echo "Test\n";
?>
--FILE--
<?php
echo "Test\n";
-class My
Request extends http\Reques
t {}
-class MyPool extends http\
Reques
t\Pool {}
-class MyShare extends http\
Reques
t\DataShare {}
+class My
Client extends http\Curl\Clien
t {}
+class MyPool extends http\
Curl\Clien
t\Pool {}
+class MyShare extends http\
Curl\Clien
t\DataShare {}
-class MyFactory extends http\
Reques
t\Factory {
+class MyFactory extends http\
Clien
t\Factory {
protected $driver = "curl";
protected $persistentHandleId = "My";
protected $driver = "curl";
protected $persistentHandleId = "My";
- protected $
requestClass = "MyReques
t";
- protected $
reques
tPoolClass = "MyPool";
- protected $
reques
tDataShareClass = "MyShare";
+ protected $
clientClass = "MyClien
t";
+ protected $
clien
tPoolClass = "MyPool";
+ protected $
clien
tDataShareClass = "MyShare";
protected $dummy = "foo";
}
$f = new MyFactory(array("driver" => "curl"));
protected $dummy = "foo";
}
$f = new MyFactory(array("driver" => "curl"));
-$r = $f->create
Reques
t();
+$r = $f->create
Clien
t();
$p = $f->createPool();
$s = $f->createDataShare();
$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(
var_dump(
- array_map("get_class", array($f,$r,$p,$s)),
+ array_map("get_class", array($f,$r,$p,$s
,$x,$y
)),
$f->getDriver()
);
$f->getDriver()
);
-foreach (array("
Reques
t", "Pool", "DataShare") as $type) {
+foreach (array("
Clien
t", "Pool", "DataShare") as $type) {
try {
try {
- var_dump((new http\
Reques
t\Factory(array("driver" => "nonexistant")))->{"create$type"}());
+ var_dump((new http\
Clien
t\Factory(array("driver" => "nonexistant")))->{"create$type"}());
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
@@
-45,18
+49,22
@@
echo "Done\n";
?>
--EXPECTF--
Test
?>
--EXPECTF--
Test
-array(
4
) {
+array(
6
) {
[0]=>
string(9) "MyFactory"
[1]=>
[0]=>
string(9) "MyFactory"
[1]=>
- string(
9) "MyReques
t"
+ string(
8) "MyClien
t"
[2]=>
string(6) "MyPool"
[3]=>
string(7) "MyShare"
[2]=>
string(6) "MyPool"
[3]=>
string(7) "MyShare"
+ [4]=>
+ string(6) "MyPool"
+ [5]=>
+ string(7) "MyShare"
}
string(4) "curl"
}
string(4) "curl"
-
reques
ts are not supported by this driver
+
clien
ts are not supported by this driver
pools are not supported by this driver
datashares are not supported by this driver
Done
pools are not supported by this driver
datashares are not supported by this driver
Done