Annotation of embedaddon/php/ext/pdo_sqlite/tests/pdo_sqlite_transaction.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: PDO_sqlite: Testing transaction
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: $db = new pdo('sqlite::memory:');
                      9: 
                     10: $db->beginTransaction();
                     11: 
                     12: $db->query('CREATE TABLE IF NOT EXISTS foobar (id INT AUTO INCREMENT, name TEXT)');
                     13: $db->commit();
                     14: 
                     15: $db->beginTransaction();
                     16: $db->query('INSERT INTO foobar VALUES (NULL, "PHP")');
                     17: $db->query('INSERT INTO foobar VALUES (NULL, "PHP6")');
                     18: $db->rollback();
                     19: 
                     20: $r = $db->query('SELECT COUNT(*) FROM foobar');
                     21: var_dump($r->rowCount());
                     22: 
                     23: 
                     24: $db->query('DROP TABLE foobar');
                     25: 
                     26: ?>
                     27: --EXPECTF--
                     28: int(0)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>