cvs: pear /DB/tests numrows.inc
| From: | Daniel Convissor | Date: | Sun, 23 Oct 2005 17:11:22 +0000 |
| Subject: | cvs: pear /DB/tests numrows.inc | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35803@lists.php.net to get a copy of this message | ||
danielc Sun Oct 23 13:11:22 2005 EDT
Modified files:
/pear/DB/tests numrows.inc
Log:
* Check for right error code, DB_ERROR_UNSUPPORTED.
* Make test more robust.
http://cvs.php.net/diff.php/pear/DB/tests/numrows.inc?r1=1.12&r2=1.13&ty=u
Index: pear/DB/tests/numrows.inc
diff -u pear/DB/tests/numrows.inc:1.12 pear/DB/tests/numrows.inc:1.13
--- pear/DB/tests/numrows.inc:1.12 Wed Feb 9 02:07:24 2005
+++ pear/DB/tests/numrows.inc Sun Oct 23 13:11:19 2005
@@ -18,7 +18,7 @@
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version $Id: numrows.inc,v 1.12 2005/02/09 07:07:24 danielc Exp $
+ * @version $Id: numrows.inc,v 1.13 2005/10/23 17:11:19 danielc Exp $
* @link http://pear.php.net/package/DB
*/
@@ -33,13 +33,14 @@
* @see PEAR::setErrorHandling()
*/
function pe($o) {
- global $dbh;
+ global $dbh, $res;
$dbh->setErrorHandling(PEAR_ERROR_RETURN);
+ $res->free();
drop_table($dbh, 'phptest');
print "\n------------\n";
- if ($o->getCode() == DB_ERROR_NOT_CAPABLE) {
+ if ($o->getCode() == DB_ERROR_UNSUPPORTED) {
print "This DBMS does not support numRows().";
} elseif ($o->getCode() == DB_ERROR_MISMATCH) {
print "Mismatch between the number of placeholders and parameters.\n";
@@ -105,6 +106,4 @@
}
-$res->free(); // keep ibase happy
-$dbh->setErrorHandling(PEAR_ERROR_RETURN);
drop_table($dbh, 'phptest');