svn: /pear/packages/MDB2/trunk/tests/ MDB2_bugs_testcase.php
| From: | Lorenzo Alberton | Date: | Sun, 06 Mar 2011 11:32:53 +0000 |
| Subject: | svn: /pear/packages/MDB2/trunk/tests/ MDB2_bugs_testcase.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-61349@lists.php.net to get a copy of this message | ||
quipo Sun, 06 Mar 2011 11:32:53 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=308956
Log:
test case for bug #18203
Bug: http://pear.php.net/bugs/18203 (unknown)
Changed paths:
U pear/packages/MDB2/trunk/tests/MDB2_bugs_testcase.php
Modified: pear/packages/MDB2/trunk/tests/MDB2_bugs_testcase.php
===================================================================
--- pear/packages/MDB2/trunk/tests/MDB2_bugs_testcase.php 2011-03-06 11:30:20 UTC (rev 308955)
+++ pear/packages/MDB2/trunk/tests/MDB2_bugs_testcase.php 2011-03-06 11:32:53 UTC (rev 308956)
@@ -286,6 +286,23 @@
$this->assertFalse(is_bool($result['user_name']));
}
}
+
+ /**
+ * Type introspection breaks with associative arrays if names are identical
+ * @see http://pear.php.net/bugs/bug.php?id=18203
+ */
+ function testBug18203() {
+ $res = $this->db->query("SELECT 1 as id, 2 as id, 'foo' as
title", true);
+ if (PEAR::isError($res)) {
+ $this->fail($res->getMessage());
+ }
+ $record = $res->fetchRow(MDB2_FETCHMODE_ASSOC);
+ $expected = array(
+ 'id' => 2,
+ 'title' => 'foo'
+ );
+ $this->assertEquals($expected, $record);
+ }
}
?>
\ No newline at end of file