summaryrefslogtreecommitdiff
path: root/ext/intl/tests/badargs.phpt
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2009-12-23 21:41:05 +0000
committerStanislav Malyshev <stas@php.net>2009-12-23 21:41:05 +0000
commit882a89fb227915c4fd1cecb9f13850f90e80020c (patch)
tree22a8caa276e2c64615957f901685f6890445765b /ext/intl/tests/badargs.phpt
parentf0c1cd512f53c787058d40f025bbbed529122309 (diff)
downloadphp-git-882a89fb227915c4fd1cecb9f13850f90e80020c.tar.gz
cleanup some code, improve error handling
Diffstat (limited to 'ext/intl/tests/badargs.phpt')
-rwxr-xr-xext/intl/tests/badargs.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/intl/tests/badargs.phpt b/ext/intl/tests/badargs.phpt
new file mode 100755
index 0000000000..9232bbf0c1
--- /dev/null
+++ b/ext/intl/tests/badargs.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Check that bad argumens return the same
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+$funcs = get_extension_funcs("intl");
+function ignore_err() {}
+set_error_handler("ignore_err");
+$arg = new stdClass();
+foreach($funcs as $func) {
+ $rfunc = new ReflectionFunction($func);
+ if($rfunc->getNumberOfRequiredParameters() == 0) {
+ continue;
+ }
+ $res = $func($arg);
+ if($res != false) {
+ echo "$func: ";
+ var_dump($res);
+ }
+}
+echo "OK!\n";
+?>
+--EXPECT--
+OK!