]> granicus.if.org Git - php/commitdiff
- New test
authorFelipe Pena <felipe@php.net>
Mon, 1 Sep 2008 23:41:34 +0000 (23:41 +0000)
committerFelipe Pena <felipe@php.net>
Mon, 1 Sep 2008 23:41:34 +0000 (23:41 +0000)
ext/fileinfo/tests/mime_content_type_001.phpt [new file with mode: 0644]

diff --git a/ext/fileinfo/tests/mime_content_type_001.phpt b/ext/fileinfo/tests/mime_content_type_001.phpt
new file mode 100644 (file)
index 0000000..dd6ce07
--- /dev/null
@@ -0,0 +1,28 @@
+--TEST--
+mime_content_type(): Testing wrong parameters
+--FILE--
+<?php
+
+mime_content_type(1);
+mime_content_type(NULL);
+mime_content_type(new stdclass);
+mime_content_type(array());
+mime_content_type('foo/inexistent');
+mime_content_type('');
+mime_content_type("\0");
+
+?>
+--EXPECTF--
+Warning: mime_content_type(): Can only process string or stream arguments in %s on line %d
+
+Warning: mime_content_type(): Can only process string or stream arguments in %s on line %d
+
+Warning: mime_content_type(): Can only process string or stream arguments in %s on line %d
+
+Warning: mime_content_type(): Can only process string or stream arguments in %s on line %d
+
+Warning: mime_content_type(foo/inexistent): failed to open stream: No such file or directory in %s on line %d
+
+Warning: mime_content_type(): Empty filename or path in %s on line %d
+
+Warning: mime_content_type(): Empty filename or path in %s on line %d