From dd6f9ed00586f705d4704da3d57ac9326e5d5d6f Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 14 Mar 2011 16:45:52 +1300 Subject: [PATCH] MINOR Moved readonly section of TransactionTest into postgresql/ module --- tests/TransactionTest.php | 43 +++------------------------------------ 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/tests/TransactionTest.php b/tests/TransactionTest.php index 85751468d..0b7721803 100644 --- a/tests/TransactionTest.php +++ b/tests/TransactionTest.php @@ -45,46 +45,9 @@ class TransactionTest extends SapphireTest { //These pages should NOT exist, we reverted to a savepoint: $this->assertFalse(is_object($third) && $third->exists()); $this->assertFalse(is_object($forth) && $forth->exists()); + } else { + $this->markTestSkipped('Current database does not support transactions'); } } - function testReadOnlyTransaction(){ - - if(DB::getConn()->supportsTransactions()==true){ - - $page=new Page(); - $page->Title='Read only success'; - $page->write(); - - DB::getConn()->transactionStart('READ ONLY'); - - try { - $page=new Page(); - $page->Title='Read only page failed'; - $page->write(); - } catch (Exception $e) { - //could not write this record - //We need to do a rollback or a commit otherwise we'll get error messages - DB::getConn()->transactionRollback(); - } - - DB::getConn()->transactionEnd(); - - DataObject::flush_and_destroy_cache(); - - $success=DataObject::get('Page', "\"Title\"='Read only success'"); - $fail=DataObject::get('Page', "\"Title\"='Read only page failed'"); - - //This page should be in the system - $this->assertTrue(is_object($success) && $success->exists()); - - //This page should NOT exist, we had 'read only' permissions - $this->assertFalse(is_object($fail) && $fail->exists()); - - } - - } - -} - -?> \ No newline at end of file +} \ No newline at end of file