xref: /php-src/ext/pdo/tests/pecl_bug_5772.phpt (revision f4a5db3e)
1--TEST--
2PDO Common: PECL Bug #5772 (PDO::FETCH_FUNC breaks on mixed case func name)
3--EXTENSIONS--
4pdo
5--SKIPIF--
6<?php
7$dir = getenv('REDIR_TEST_DIR');
8if (false == $dir) die('skip no driver');
9require_once $dir . 'pdo_test.inc';
10PDOTest::skip();
11?>
12--FILE--
13<?php
14if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/');
15require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
16$db = PDOTest::factory();
17
18$db->exec("CREATE TABLE test5772 (id int NOT NULL, PRIMARY KEY (id))");
19$db->exec("INSERT INTO test5772 (id) VALUES (1)");
20
21function heLLO($row) {
22    return $row;
23}
24
25foreach ($db->query("SELECT * FROM test5772")->fetchAll(PDO::FETCH_FUNC, 'heLLO') as $row) {
26    var_dump($row);
27}
28?>
29--CLEAN--
30<?php
31require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
32$db = PDOTest::factory();
33PDOTest::dropTableIfExists($db, "test5772");
34?>
35--EXPECT--
36string(1) "1"
37