1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/tests/TransactionSqliteTestCase.php

26 lines
1.1 KiB
PHP
Raw Normal View History

<?php
2006-11-24 02:23:24 +03:00
class Doctrine_Transaction_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase {
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');
$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');
}
}