2006-11-23 18:30:00 +03:00
|
|
|
<?php
|
2006-11-24 02:23:24 +03:00
|
|
|
class Doctrine_Transaction_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase {
|
2006-11-23 18:30:00 +03:00
|
|
|
public function __construct() {
|
|
|
|
parent::__construct('sqlite');
|
|
|
|
}
|
|
|
|
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode() {
|
|
|
|
try {
|
|
|
|
$this->transaction->setIsolation('unknown');
|
|
|
|
$this->fail();
|
|
|
|
} catch(Doctrine_Transaction_Exception $e) {
|
|
|
|
$this->pass();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public function testSetIsolationExecutesSql() {
|
|
|
|
$this->transaction->setIsolation('READ UNCOMMITTED');
|
|
|
|
$this->transaction->setIsolation('READ COMMITTED');
|
|
|
|
$this->transaction->setIsolation('REPEATABLE READ');
|
2006-11-24 02:23:24 +03:00
|
|
|
$this->transaction->setIsolation('SERIALIZABLE');
|
|
|
|
|
2006-11-23 18:30:00 +03:00
|
|
|
$this->assertEqual($this->adapter->pop(), 'PRAGMA read_uncommitted = 1');
|
|
|
|
$this->assertEqual($this->adapter->pop(), 'PRAGMA read_uncommitted = 1');
|
|
|
|
$this->assertEqual($this->adapter->pop(), 'PRAGMA read_uncommitted = 1');
|
2006-11-24 02:23:24 +03:00
|
|
|
$this->assertEqual($this->adapter->pop(), 'PRAGMA read_uncommitted = 0');
|
2006-11-23 18:30:00 +03:00
|
|
|
}
|
|
|
|
}
|