- make http_parse_cookie() "quoted string" aware and add test
[m6w6/ext-http] / tests / parse_cookie_001.phpt
diff --git a/tests/parse_cookie_001.phpt b/tests/parse_cookie_001.phpt
new file mode 100644 (file)
index 0000000..3e42f6b
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+parse cookie
+--SKIPIF--
+<?php
+include 'skip.inc';
+?>
+--FILE--
+<?php
+echo "-TEST\n";
+
+var_dump(http_parse_cookie('name="value"; foo="bar\"baz"; hey=got\"it'));
+
+echo "Done\n";
+?>
+--EXPECTF--
+%sTEST
+object(stdClass)#1 (4) {
+  ["name"]=>
+  string(4) "name"
+  ["value"]=>
+  string(5) "value"
+  ["foo"]=>
+  string(7) "bar"baz"
+  ["hey"]=>
+  string(7) "got\"it"
+}
+Done