]> granicus.if.org Git - php/commitdiff
Add test for bug #78075, json detection
authorAnatol Belski <ab@php.net>
Thu, 30 May 2019 11:31:48 +0000 (13:31 +0200)
committerAnatol Belski <ab@php.net>
Thu, 30 May 2019 11:31:48 +0000 (13:31 +0200)
ext/fileinfo/tests/finfo_file_002.phpt
ext/fileinfo/tests/resources/test.json [new file with mode: 0644]

index 683be5b676c076b7947b4d29126ae0d5c13aa79f..fff16b77969857fae2f6a2dbfa58e0685637ccb9 100644 (file)
@@ -29,6 +29,8 @@ array(%d) {
   string(9) "image/gif"
   ["%s/resources/test.jpg"]=>
   string(10) "image/jpeg"
+  ["%s/test.json"]=>
+  string(16) "application/json"
   ["%s/resources/test.mp3"]=>
   string(10) "audio/mpeg"
   ["%s/resources/test.pdf"]=>
diff --git a/ext/fileinfo/tests/resources/test.json b/ext/fileinfo/tests/resources/test.json
new file mode 100644 (file)
index 0000000..1d8a952
--- /dev/null
@@ -0,0 +1,13 @@
+{\r
+    "abc": "edf",\r
+    "json": "crab",\r
+    "ololo": [\r
+        1,\r
+        2,\r
+        3\r
+    ],\r
+    "subcrab": {\r
+        "name": "crab",\r
+        "surname": "subcrab"\r
+    }\r
+}\r