Annotation of embedaddon/php/ext/pdo/tests/bug_43139.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: PDO Common: Bug #43139 (PDO ignore ATTR_DEFAULT_FETCH_MODE in some cases with fetchAll())
3: --SKIPIF--
4: <?php # vim:ft=php
5: if (!extension_loaded('pdo')) die('skip');
6: $dir = getenv('REDIR_TEST_DIR');
7: if (false == $dir) die('skip no driver');
8: require_once $dir . 'pdo_test.inc';
9: PDOTest::skip();
10: ?>
11: --FILE--
12: <?php
13: if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
14: require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
15: $db = PDOTest::factory();
16:
17: $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
18: $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
19:
20: $from = '';
21: if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
22: $from = 'from dual';
23: } else if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'firebird') {
24: $from = 'FROM RDB$DATABASE';
25: }
26:
27: var_dump($db->query("select 0 as abc, 1 as xyz, 2 as def $from")->fetchAll(PDO::FETCH_GROUP));
28: ?>
29: --EXPECT--
30: array(1) {
31: [0]=>
32: array(1) {
33: [0]=>
34: array(2) {
35: ["xyz"]=>
36: string(1) "1"
37: ["def"]=>
38: string(1) "2"
39: }
40: }
41: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>