diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt')
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt new file mode 100644 index 0000000..b9a4fc9 --- /dev/null +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_fetch_table_names.phpt @@ -0,0 +1,42 @@ +--TEST-- +PDO::ATTR_FETCH_TABLE_NAMES +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc'); +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::skip(); +?> +--FILE-- +<?php + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); + $db = MySQLPDOTest::factory(); + MySQLPDOTest::createTestTable($db); + + $db->setAttribute(PDO::ATTR_FETCH_TABLE_NAMES, 1); + $stmt = $db->query('SELECT label FROM test LIMIT 1'); + var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); + $stmt->closeCursor(); + + $db->setAttribute(PDO::ATTR_FETCH_TABLE_NAMES, 0); + $stmt = $db->query('SELECT label FROM test LIMIT 1'); + var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); + $stmt->closeCursor(); + + print "done!"; +?> +--EXPECTF-- +array(1) { + [0]=> + array(1) { + [%u|b%"test.label"]=> + %unicode|string%(1) "a" + } +} +array(1) { + [0]=> + array(1) { + [%u|b%"label"]=> + %unicode|string%(1) "a" + } +} +done! |