tests++
authorMichael Wallner <mike@php.net>
Thu, 12 Feb 2015 21:44:31 +0000 (22:44 +0100)
committerMichael Wallner <mike@php.net>
Thu, 12 Feb 2015 21:44:31 +0000 (22:44 +0100)
tests/client023.phpt [new file with mode: 0644]
tests/client024.phpt [new file with mode: 0644]

diff --git a/tests/client023.phpt b/tests/client023.phpt
new file mode 100644 (file)
index 0000000..b09c2e2
--- /dev/null
@@ -0,0 +1,39 @@
+--TEST--
+client available options and configuration
+--SKIPIF--
+<?php 
+include "skipif.inc";
+skip_client_test();
+?>
+--FILE--
+<?php 
+
+echo "Test\n";
+
+$client = new http\Client;
+if (($opt = $client->getOptions())) {
+       var_dump($options);
+}
+$client->setOptions($avail = $client->getAvailableOptions());
+$opt = $client->getOptions();
+
+foreach ($avail as $k => $v) {
+       if (is_array($v)) {
+               $oo = $opt[$k];
+               foreach ($v as $kk => $vv) {
+                       if (isset($vv) && $oo[$kk] !== $vv) {
+                               var_dump([$kk => [$vv, $oo[$kk]]]);
+                       }
+               }
+       } else if (isset($v) && $opt[$k] !== $v) {
+               var_dump([$k => [$v, $opt[$k]]]);
+       }
+}
+var_dump($client === $client->configure($client->getAvailableConfiguration()));
+
+?>
+===DONE===
+--EXPECT--
+Test
+bool(true)
+===DONE===
diff --git a/tests/client024.phpt b/tests/client024.phpt
new file mode 100644 (file)
index 0000000..27a68b4
--- /dev/null
@@ -0,0 +1,25 @@
+--TEST--
+client deprecated methods
+--SKIPIF--
+<?php 
+include "skipif.inc";
+skip_client_test();
+?>
+--FILE--
+<?php 
+
+echo "Test\n";
+
+$client = new http\Client;
+$client->enableEvents(false);
+$client->enablePipelining(false);
+
+?>
+===DONE===
+--EXPECTF--
+Test
+
+Deprecated: Function http\Client::enableEvents() is deprecated in %sclient024.php on line %d
+
+Deprecated: Function http\Client::enablePipelining() is deprecated in %sclient024.php on line %d
+===DONE===