diff options
| author | Ondřej Surý <ondrej@sury.org> | 2010-03-09 11:57:54 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2010-03-09 11:57:54 +0100 |
| commit | 855a09f4eded707941180c9d90acd17c25e29447 (patch) | |
| tree | a40947efaa9876f31b6ee3956c3f3775768143bb /ext/pdo/tests | |
| parent | c852c28a88fccf6e34a2cb091fdfa72bce2b59c7 (diff) | |
| download | php-855a09f4eded707941180c9d90acd17c25e29447.tar.gz | |
Imported Upstream version 5.3.2upstream/5.3.2
Diffstat (limited to 'ext/pdo/tests')
| -rw-r--r-- | ext/pdo/tests/bug_44861.phpt | 2 | ||||
| -rw-r--r-- | ext/pdo/tests/bug_50458.phpt | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/ext/pdo/tests/bug_44861.phpt b/ext/pdo/tests/bug_44861.phpt index a39237290..3612561ed 100644 --- a/ext/pdo/tests/bug_44861.phpt +++ b/ext/pdo/tests/bug_44861.phpt @@ -32,7 +32,7 @@ if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') { $from = ''; } -$query = "SELECT 'row1' AS r $from UNION SELECT 'row2' $from UNION SELECT 'row3' $from UNION SELECT 'row4' $from"; +$query = "SELECT 'row1' AS r $from UNION SELECT 'row2' $from UNION SELECT 'row3' $from UNION SELECT 'row4' $from ORDER BY r"; $aParams = array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL); $res = $db->prepare($query, $aParams); 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=== |
