Skip to content
Browse files

MINOR Moved readonly section of TransactionTest into postgresql/ module

  • Loading branch information...
1 parent b70ff87 commit dd6f9ed00586f705d4704da3d57ac9326e5d5d6f @chillu chillu committed
Showing with 3 additions and 40 deletions.
  1. +3 −40 tests/TransactionTest.php
View
43 tests/TransactionTest.php
@@ -45,46 +45,9 @@ function testCreateWithTransaction() {
//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());
-
- }
-
- }
-
-}
-
-?>
+}

0 comments on commit dd6f9ed

Please sign in to comment.
Something went wrong with that request. Please try again.