Handle application/json as well
[m6w6/ext-json_post] / tests / application.phpt
diff --git a/tests/application.phpt b/tests/application.phpt
new file mode 100644 (file)
index 0000000..1331be4
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+json_post with Content-Type: application/json
+--SKIPIF--
+<?php
+extension_loaded("json_post") or die("skip need json_post support\n");
+?>
+--POST_RAW--
+Content-Type: application/json
+
+{
+       "greeting": "Hello World"
+}
+--FILE--
+<?php
+var_dump($_POST, json_last_error());
+?>
+Done
+--EXPECTF--
+array(1) {
+  ["greeting"]=>
+  string(11) "Hello World"
+}
+int(0)
+Done