summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_count_values_variation.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/array/array_count_values_variation.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/array/array_count_values_variation.phpt')
-rw-r--r--ext/standard/tests/array/array_count_values_variation.phpt51
1 files changed, 51 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 0000000..89d7f37
--- /dev/null
+++ b/ext/standard/tests/array/array_count_values_variation.phpt
@@ -0,0 +1,51 @@
+--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";
+?>
+
+--CLEAN--
+<?php
+unlink("array_count_file");
+?>
+--EXPECTF--
+*** Testing array_count_values() : parameter variations ***
+array(3) {
+ ["bobv"]=>
+ int(1)
+ ["val"]=>
+ int(1)
+ ["val6"]=>
+ int(1)
+}
+
+Done