summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2008-12-02 21:01:37 +0000
committerFelipe Pena <felipe@php.net>2008-12-02 21:01:37 +0000
commit00cb5de0ab834ba1d989590ea33c57e891b1dbe5 (patch)
tree666985b5c6e58a5646d1b67db25447fac53af777 /ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt
parent7a28b876e4c7c5d5ba40e34b8616ef6a8e31caf1 (diff)
downloadphp-git-00cb5de0ab834ba1d989590ea33c57e891b1dbe5.tar.gz
MFH:
- Fixed memory leaks - Added new tests (Coverage++)
Diffstat (limited to 'ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt')
-rw-r--r--ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt26
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt
new file mode 100644
index 0000000000..75f4169870
--- /dev/null
+++ b/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt
@@ -0,0 +1,26 @@
+--TEST--
+PDO_sqlite: Testing transaction
+--FILE--
+<?php
+
+$db = new pdo('sqlite:memory');
+
+$db->beginTransaction();
+
+$db->query('CREATE TABLE IF NOT EXISTS foobar (id INT AUTO INCREMENT, name TEXT)');
+$db->commit();
+
+$db->beginTransaction();
+$db->query('INSERT INTO foobar VALUES (NULL, "PHP")');
+$db->query('INSERT INTO foobar VALUES (NULL, "PHP6")');
+$db->rollback();
+
+$r = $db->query('SELECT COUNT(*) FROM foobar');
+var_dump($r->rowCount());
+
+
+$db->query('DROP TABLE foobar');
+
+?>
+--EXPECTF--
+int(0)