summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_count_values_variation.phpt
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
committerSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
commitcd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f (patch)
tree1315c623bb7d9dfa8d366fa9cd2c6834ceeb5da5 /ext/standard/tests/array/array_count_values_variation.phpt
parent9ea47aab740772adf0c69d8c94b208a464e599ea (diff)
downloadphp-upstream/5.2.9.dfsg.1.tar.gz
Imported Upstream version 5.2.9.dfsg.1upstream/5.2.9.dfsg.1
Diffstat (limited to 'ext/standard/tests/array/array_count_values_variation.phpt')
-rw-r--r--ext/standard/tests/array/array_count_values_variation.phpt47
1 files changed, 47 insertions, 0 deletions
diff --git a/ext/standard/tests/array/array_count_values_variation.phpt b/ext/standard/tests/array/array_count_values_variation.phpt
new file mode 100644
index 000000000..efd3c81cc
--- /dev/null
+++ b/ext/standard/tests/array/array_count_values_variation.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Test array_count_values() function : Test all normal paramter variations
+--FILE--
+<?php
+/* Prototype : proto array array_count_values(array input)
+ * Description: Return the value as key and the frequency of that value in input as value
+ * Source code: ext/standard/array.c
+ * Alias to functions:
+ */
+
+/*
+ * Test behaviour with paramter variations
+ */
+
+echo "*** Testing array_count_values() : parameter variations ***\n";
+
+class A {
+ static function hello() {
+ echo "Hello\n";
+ }
+}
+
+$ob = new A();
+
+$fp = fopen("array_count_file", "w+");
+
+$arrays = array ("bobk" => "bobv", "val", 6 => "val6", $fp, $ob);
+
+var_dump (@array_count_values ($arrays));
+echo "\n";
+
+
+echo "Done";
+?>
+
+--EXPECTF--
+*** Testing array_count_values() : parameter variations ***
+array(3) {
+ ["bobv"]=>
+ int(1)
+ ["val"]=>
+ int(1)
+ ["val6"]=>
+ int(1)
+}
+
+Done \ No newline at end of file