From: Dan Scott Date: Sat, 5 Mar 2005 21:03:12 +0000 (+0000) Subject: Test PDO::beginTransaction and PDO::rollBack. X-Git-Tag: RELEASE_0_3~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48a6151051afd1db737a75db51f2a065be97bb6a;p=php Test PDO::beginTransaction and PDO::rollBack. --- diff --git a/ext/pdo/tests/pdo_017.inc b/ext/pdo/tests/pdo_017.inc new file mode 100755 index 0000000000..7c198a43fa --- /dev/null +++ b/ext/pdo/tests/pdo_017.inc @@ -0,0 +1,32 @@ +query($SQL['select']); + $res = $stmt->fetchSingle(); + return "Counted $res rows after $action.\n"; +} + +$DB->exec($SQL['create']); +$DB->exec($SQL['insert1']); +$DB->exec($SQL['insert2']); +$DB->exec($SQL['insert3']); + +echo countRows($DB, 'insert'); + +$DB->beginTransaction(); +$DB->exec($SQL['delete']); +echo countRows($DB, 'delete'); +$DB->rollBack(); + +echo countRows($DB, 'rollback'); +?> diff --git a/ext/pdo_odbc/tests/pdo_017.phpt b/ext/pdo_odbc/tests/pdo_017.phpt new file mode 100755 index 0000000000..5221c3dfc0 --- /dev/null +++ b/ext/pdo_odbc/tests/pdo_017.phpt @@ -0,0 +1,21 @@ +--TEST-- +PDO_ODBC: PDO::beginTransaction / PDO::rollBack +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECT-- +Counted 3 rows after insert. +Counted 0 rows after delete. +Counted 3 rows after rollback. +===DONE===