summaryrefslogtreecommitdiff
path: root/ext/standard/tests/class_object/get_class_vars_error.phpt
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /ext/standard/tests/class_object/get_class_vars_error.phpt
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/standard/tests/class_object/get_class_vars_error.phpt')
-rw-r--r--ext/standard/tests/class_object/get_class_vars_error.phpt38
1 files changed, 38 insertions, 0 deletions
diff --git a/ext/standard/tests/class_object/get_class_vars_error.phpt b/ext/standard/tests/class_object/get_class_vars_error.phpt
new file mode 100644
index 0000000..0399e60
--- /dev/null
+++ b/ext/standard/tests/class_object/get_class_vars_error.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Test get_class_vars() function : error conditions
+--FILE--
+<?php
+/* Prototype : array get_class_vars(string class_name)
+ * Description: Returns an array of default properties of the class.
+ * Source code: Zend/zend_builtin_functions.c
+ * Alias to functions:
+ */
+
+echo "*** Testing get_class_vars() : error conditions ***\n";
+
+
+//Test get_class_vars with one more than the expected number of arguments
+echo "\n-- Testing get_class_vars() function with more than expected no. of arguments --\n";
+$obj = new stdclass();
+$extra_arg = 10;
+var_dump(get_class_vars($obj,$extra_arg) );
+
+// Testing get_class_vars with one less than the expected number of arguments
+echo "\n-- Testing get_class_vars() function with less than expected no. of arguments --\n";
+var_dump(get_class_vars());
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing get_class_vars() : error conditions ***
+
+-- Testing get_class_vars() function with more than expected no. of arguments --
+
+Warning: get_class_vars() expects exactly 1 parameter, 2 given in %sget_class_vars_error.php on line %d
+NULL
+
+-- Testing get_class_vars() function with less than expected no. of arguments --
+
+Warning: get_class_vars() expects exactly 1 parameter, 0 given in %sget_class_vars_error.php on line %d
+NULL
+===DONE=== \ No newline at end of file