unfold param tests
[m6w6/ext-http] / tests / params007.phpt
diff --git a/tests/params007.phpt b/tests/params007.phpt
new file mode 100644 (file)
index 0000000..c56e2fa
--- /dev/null
@@ -0,0 +1,35 @@
+--TEST--
+urlencoded params
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$s = "foo=b%22r&bar=b%22z&a%5B%5D%5B%5D=1";
+$p = new http\Params($s, "&", "", "=", http\Params::PARSE_URLENCODED);
+$c = array(
+       "foo" => array(
+               "value" => "b\"r",
+               "arguments" => array(),
+       ),
+       "bar" => array(
+               "value" => "b\"z",
+               "arguments" => array(),
+       ),
+       "a[][]" => array(
+               "value" => "1",
+               "arguments" => array(),
+       ),
+);
+var_dump($c === $p->params);
+var_dump("foo=b%22r&bar=b%22z&a%5B%5D%5B%5D=1" === (string) $p);
+?>
+DONE
+--EXPECT--
+Test
+bool(true)
+bool(true)
+DONE