com php-src: Adding tests for the negative results of array_column(): ext/standard/tests/array/array_colu mn.phpt
| From: | David Soria Parra | Date: | Fri, 11 Jan 2013 20:16:19 +0000 |
| Subject: | com php-src: Adding tests for the negative results of array_column(): ext/standard/tests/array/array_colu mn.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71665@lists.php.net to get a copy of this message | ||
Commit: a811e5b6f78dfd56074758fa17d37816628d928f
Author: Ben Ramsey <ramsey@php.net> Fri, 13 Apr 2012 23:43:04 -0500
Parents: 9035a1ed246d4d2d867edc01616ca96b40a7cd11
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a811e5b6f78dfd56074758fa17d37816628d928f
Log:
Adding tests for the negative results of array_column()
Changed paths:
M ext/standard/tests/array/array_column.phpt
Diff:
diff --git a/ext/standard/tests/array/array_column.phpt b/ext/standard/tests/array/array_column.phpt
index 08df3b8..8beb0c2 100644
--- a/ext/standard/tests/array/array_column.phpt
+++ b/ext/standard/tests/array/array_column.phpt
@@ -82,6 +82,14 @@ $numericCols = array(
);
var_dump(array_column($numericCols, 1));
+echo "\n*** Testing failure to find specified column ***\n";
+var_dump(array_column($numericCols, 2));
+var_dump(array_column($numericCols, 'foo'));
+
+echo "\n*** Testing single dimensional array ***\n";
+$singleDimension = array('foo', 'bar', 'baz');
+var_dump(array_column($singleDimension, 1));
+
echo "Done\n";
?>
--EXPECTF--
@@ -135,4 +143,14 @@ array(3) {
[2]=>
string(3) "333"
}
+
+*** Testing failure to find specified column ***
+array(0) {
+}
+array(0) {
+}
+
+*** Testing single dimensional array ***
+array(0) {
+}
Done