ensure options are applied before the headers are set
[m6w6/ext-http] / tests / params001.phpt
index 1fec867eef846ded614ffec13ef4e41ff7bda633..5b28deed83a041d1c355fd3e5bc658bceb72f643 100644 (file)
@@ -8,7 +8,7 @@ include "skipif.inc";
 <?php
 echo "Test\n";
 
-$ct = new http\Params("text/html; charset=utf-8");
+$ct = new http\Params("text/html; charset=utf-8", ",", ";", "=", 0);
 
 var_dump(
        isset($ct["text/html"]),
@@ -26,9 +26,10 @@ var_dump(
        $ct["text/json"]["arguments"]["charset"]
 );
 
-var_dump((string) $ct);
+var_dump((string) $ct,$ct);
 
-echo "Done\n";
+?>
+DONE
 --EXPECTF--
 Test
 bool(true)
@@ -38,4 +39,27 @@ bool(false)
 bool(true)
 string(10) "iso-8859-1"
 string(%d) "text/json;charset=iso-8859-1"
-Done
+object(http\Params)#%d (5) {
+  ["params"]=>
+  array(1) {
+    ["text/json"]=>
+    array(2) {
+      ["value"]=>
+      bool(true)
+      ["arguments"]=>
+      array(1) {
+        ["charset"]=>
+        string(10) "iso-8859-1"
+      }
+    }
+  }
+  ["param_sep"]=>
+  string(1) ","
+  ["arg_sep"]=>
+  string(1) ";"
+  ["val_sep"]=>
+  string(1) "="
+  ["flags"]=>
+  int(0)
+}
+DONE