summaryrefslogtreecommitdiff
path: root/ext/pdo/tests/bug_50458.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo/tests/bug_50458.phpt')
-rw-r--r--ext/pdo/tests/bug_50458.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/pdo/tests/bug_50458.phpt b/ext/pdo/tests/bug_50458.phpt
new file mode 100644
index 000000000..3deb2892e
--- /dev/null
+++ b/ext/pdo/tests/bug_50458.phpt
@@ -0,0 +1,29 @@
+--TEST--
+PDO Common: Bug #50458 (PDO::FETCH_FUNC fails with Closures)
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+
+$db = PDOTest::factory();
+$db->exec("CREATE TABLE test (a VARCHAR(10))");
+$db->exec("INSERT INTO test (a) VALUES ('xyz')");
+$res = $db->query("SELECT a FROM test");
+var_dump($res->fetchAll(PDO::FETCH_FUNC, function($a) { return strtoupper($a); }));
+
+?>
+===DONE===
+--EXPECTF--
+array(1) {
+ [0]=>
+ string(3) "XYZ"
+}
+===DONE===