summaryrefslogtreecommitdiff
path: root/ext/pdo_firebird/tests
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-11-18 01:24:00 +0000
committerFelipe Pena <felipe@php.net>2010-11-18 01:24:00 +0000
commite516b7a96491315973b43255d6dd99a7ea17ed38 (patch)
treed9b62b85c4214789ebd4ab767f448cc8d22a41de /ext/pdo_firebird/tests
parent6f7821a82dcfc2d62bfcec70ac08023dfee62499 (diff)
downloadphp-git-e516b7a96491315973b43255d6dd99a7ea17ed38.tar.gz
- Fixed bug #53335 (pdo_firebird did not implement rowCount())
patch by: preeves at ibphoenix dot com
Diffstat (limited to 'ext/pdo_firebird/tests')
-rw-r--r--ext/pdo_firebird/tests/rowCount.phpt48
1 files changed, 48 insertions, 0 deletions
diff --git a/ext/pdo_firebird/tests/rowCount.phpt b/ext/pdo_firebird/tests/rowCount.phpt
new file mode 100644
index 0000000000..02029ceef9
--- /dev/null
+++ b/ext/pdo_firebird/tests/rowCount.phpt
@@ -0,0 +1,48 @@
+--TEST--
+PDO_Firebird: rowCount
+--SKIPIF--
+<?php extension_loaded("pdo_firebird") or die("skip"); ?>
+--FILE--
+<?php /* $Id$ */
+
+require("testdb.inc");
+
+$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
+
+@$dbh->exec('DROP TABLE testz');
+$dbh->exec('CREATE TABLE testz (A VARCHAR(10))');
+$dbh->exec("INSERT INTO testz VALUES ('A')");
+$dbh->exec("INSERT INTO testz VALUES ('A')");
+$dbh->exec("INSERT INTO testz VALUES ('B')");
+$dbh->commit();
+
+$query = "SELECT * FROM testz WHERE A = ?";
+
+$stmt = $dbh->prepare($query);
+$stmt->execute(array('A'));
+$rows = $stmt->fetch();
+$rows = $stmt->fetch();
+var_dump($stmt->fetch());
+var_dump($stmt->rowCount());
+
+$stmt = $dbh->prepare('UPDATE testZ SET A="A" WHERE A != ?');
+$stmt->execute(array('A'));
+var_dump($stmt->rowCount());
+$dbh->commit();
+
+$stmt = $dbh->prepare('DELETE FROM testz');
+$stmt->execute();
+var_dump($stmt->rowCount());
+
+$dbh->commit();
+
+$dbh->exec('DROP TABLE testz');
+
+unset($dbh);
+
+?>
+--EXPECT--
+bool(false)
+int(2)
+int(1)
+int(3)