summaryrefslogtreecommitdiff
path: root/ext/pdo_firebird/tests
diff options
context:
space:
mode:
authorArd Biesheuvel <abies@php.net>2004-06-12 03:11:16 (GMT)
committerArd Biesheuvel <abies@php.net>2004-06-12 03:11:16 (GMT)
commitc29704e066914d55748961fd916d39c9b4c74c72 (patch)
tree334fb13e868f86dd0a9cd85f4d468f5387d625b8 /ext/pdo_firebird/tests
parent493b89c3b1d898dca6b7a0964ff967d4e22d113f (diff)
downloadphp-c29704e066914d55748961fd916d39c9b4c74c72.tar.gz
New test
Diffstat (limited to 'ext/pdo_firebird/tests')
-rw-r--r--ext/pdo_firebird/tests/execute.phpt54
1 files changed, 54 insertions, 0 deletions
diff --git a/ext/pdo_firebird/tests/execute.phpt b/ext/pdo_firebird/tests/execute.phpt
new file mode 100644
index 0000000..6f9794c
--- /dev/null
+++ b/ext/pdo_firebird/tests/execute.phpt
@@ -0,0 +1,54 @@
+--TEST--
+PDO_Firebird: prepare/execute/binding
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--FILE--
+<?php /* $Id$ */
+
+ require("testdb.inc");
+
+ $db = new PDO("firebird:dbname=$test_base",$user,$password) or die;
+ $db->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_WARNING);
+
+ $db->exec("CREATE TABLE ddl (id SMALLINT NOT NULL PRIMARY KEY, text VARCHAR(32))");
+ $db->exec("INSERT INTO ddl VALUES (1,'bla')");
+
+ $s = $db->prepare("SELECT * FROM ddl WHERE id=? FOR UPDATE");
+
+ $s->bindParam(1,$id = 0);
+ $s->bindColumn(2,$var = null);
+ $id = 1;
+ $s->execute();
+ $s->setAttribute(PDO_ATTR_CURSOR_NAME, "c");
+
+ var_dump($id);
+
+ var_dump($s->fetch());
+
+ var_dump($var);
+
+ var_dump($db->exec("UPDATE ddl SET id=2 WHERE CURRENT OF c"));
+
+ var_dump($s->fetch());
+
+ unset($s);
+ unset($db);
+ echo "done\n";
+
+?>
+--EXPECT--
+int(1)
+array(4) {
+ ["ID"]=>
+ int(1)
+ [0]=>
+ int(1)
+ ["TEXT"]=>
+ string(3) "bla"
+ [1]=>
+ string(3) "bla"
+}
+string(3) "bla"
+int(1)
+bool(false)
+done