let DEV_2 be trunk
[m6w6/ext-http] / tests / client012.phpt
diff --git a/tests/client012.phpt b/tests/client012.phpt
new file mode 100644 (file)
index 0000000..71e5081
--- /dev/null
@@ -0,0 +1,36 @@
+--TEST--
+client ssl
+--SKIPIF--
+<?php 
+include "skipif.inc";
+?>
+--FILE--
+<?php 
+
+echo "Test\n";
+
+$client = new http\Client;
+
+$client->setSslOptions(array("verify_peer" => true));
+$client->addSslOptions(array("verify_host" => 2));
+var_dump(
+       array(
+               "verify_peer" => true,
+               "verify_host" => 2,
+       ) === $client->getSslOptions()
+);
+
+$client->enqueue($req = new http\Client\Request("GET", "https://twitter.com/"));
+$client->send();
+
+$ti = (array) $client->getTransferInfo($req);
+var_dump(array_key_exists("ssl_engines", $ti));
+var_dump(0 < count($ti["ssl_engines"]));
+?>
+Done
+--EXPECTF--
+Test
+bool(true)
+bool(true)
+bool(true)
+Done