added doc blocks, changed formatting
This commit is contained in:
parent
ddad4162ca
commit
70c23e59e3
7 changed files with 260 additions and 55 deletions
|
@ -1,25 +1,58 @@
|
||||||
<?php
|
<?php
|
||||||
class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
|
/*
|
||||||
public function __construct() {
|
* $Id$
|
||||||
parent::__construct('firebird');
|
*
|
||||||
}
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
public function testCreateSavePointExecutesSql() {
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* This software consists of voluntary contributions made by many individuals
|
||||||
|
* and is licensed under the LGPL. For more information, see
|
||||||
|
* <http://www.phpdoctrine.com>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Doctrine_Transaction_Firebird_TestCase
|
||||||
|
*
|
||||||
|
* @package Doctrine
|
||||||
|
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||||
|
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||||
|
* @category Object Relational Mapping
|
||||||
|
* @link www.phpdoctrine.com
|
||||||
|
* @since 1.0
|
||||||
|
* @version $Revision$
|
||||||
|
*/
|
||||||
|
class Doctrine_Transaction_Firebird_TestCase extends Doctrine_UnitTestCase
|
||||||
|
{
|
||||||
|
public function testCreateSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->beginTransaction('mypoint');
|
$this->transaction->beginTransaction('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testReleaseSavePointExecutesSql() {
|
public function testReleaseSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->commit('mypoint');
|
$this->transaction->commit('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testRollbackSavePointExecutesSql() {
|
public function testRollbackSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->beginTransaction('mypoint');
|
$this->transaction->beginTransaction('mypoint');
|
||||||
$this->transaction->rollback('mypoint');
|
$this->transaction->rollback('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode() {
|
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->transaction->setIsolation('unknown');
|
$this->transaction->setIsolation('unknown');
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
@ -27,7 +60,8 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas
|
||||||
$this->pass();
|
$this->pass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function testSetIsolationThrowsExceptionOnUnknownWaitMode() {
|
public function testSetIsolationThrowsExceptionOnUnknownWaitMode()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->transaction->setIsolation('READ UNCOMMITTED', array('wait' => 'unknown'));
|
$this->transaction->setIsolation('READ UNCOMMITTED', array('wait' => 'unknown'));
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
@ -35,7 +69,8 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas
|
||||||
$this->pass();
|
$this->pass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function testSetIsolationThrowsExceptionOnUnknownReadWriteMode() {
|
public function testSetIsolationThrowsExceptionOnUnknownReadWriteMode()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->transaction->setIsolation('READ UNCOMMITTED', array('rw' => 'unknown'));
|
$this->transaction->setIsolation('READ UNCOMMITTED', array('rw' => 'unknown'));
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
@ -43,7 +78,8 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas
|
||||||
$this->pass();
|
$this->pass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function testSetIsolationExecutesSql() {
|
public function testSetIsolationExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('READ UNCOMMITTED');
|
$this->transaction->setIsolation('READ UNCOMMITTED');
|
||||||
$this->transaction->setIsolation('READ COMMITTED');
|
$this->transaction->setIsolation('READ COMMITTED');
|
||||||
$this->transaction->setIsolation('REPEATABLE READ');
|
$this->transaction->setIsolation('REPEATABLE READ');
|
||||||
|
@ -54,7 +90,8 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED NO RECORD_VERSION');
|
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED NO RECORD_VERSION');
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED RECORD_VERSION');
|
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED RECORD_VERSION');
|
||||||
}
|
}
|
||||||
public function testSetIsolationSupportsReadWriteOptions() {
|
public function testSetIsolationSupportsReadWriteOptions()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('SERIALIZABLE', array('rw' => 'READ ONLY'));
|
$this->transaction->setIsolation('SERIALIZABLE', array('rw' => 'READ ONLY'));
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION READ ONLY ISOLATION LEVEL SNAPSHOT TABLE STABILITY');
|
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION READ ONLY ISOLATION LEVEL SNAPSHOT TABLE STABILITY');
|
||||||
|
@ -63,7 +100,8 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION READ WRITE ISOLATION LEVEL SNAPSHOT TABLE STABILITY');
|
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION READ WRITE ISOLATION LEVEL SNAPSHOT TABLE STABILITY');
|
||||||
}
|
}
|
||||||
public function testSetIsolationSupportsWaitOptions() {
|
public function testSetIsolationSupportsWaitOptions()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('SERIALIZABLE', array('wait' => 'NO WAIT'));
|
$this->transaction->setIsolation('SERIALIZABLE', array('wait' => 'NO WAIT'));
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION NO WAIT ISOLATION LEVEL SNAPSHOT TABLE STABILITY');
|
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION NO WAIT ISOLATION LEVEL SNAPSHOT TABLE STABILITY');
|
||||||
|
|
|
@ -30,5 +30,6 @@
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
*/
|
*/
|
||||||
class Doctrine_Transaction_Informix_TestCase extends Doctrine_UnitTestCase {
|
class Doctrine_Transaction_Informix_TestCase extends Doctrine_UnitTestCase
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,39 @@
|
||||||
<?php
|
<?php
|
||||||
class Doctrine_Transaction_Mssql_TestCase extends Doctrine_Driver_UnitTestCase {
|
/*
|
||||||
public function __construct() {
|
* $Id$
|
||||||
parent::__construct('mssql');
|
*
|
||||||
}
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode() {
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* This software consists of voluntary contributions made by many individuals
|
||||||
|
* and is licensed under the LGPL. For more information, see
|
||||||
|
* <http://www.phpdoctrine.com>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Doctrine_Transaction_Firebird_TestCase
|
||||||
|
*
|
||||||
|
* @package Doctrine
|
||||||
|
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||||
|
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||||
|
* @category Object Relational Mapping
|
||||||
|
* @link www.phpdoctrine.com
|
||||||
|
* @since 1.0
|
||||||
|
* @version $Revision$
|
||||||
|
*/
|
||||||
|
class Doctrine_Transaction_Mssql_TestCase extends Doctrine_Driver_UnitTestCase
|
||||||
|
{
|
||||||
|
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->transaction->setIsolation('unknown');
|
$this->transaction->setIsolation('unknown');
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
@ -11,7 +41,8 @@ class Doctrine_Transaction_Mssql_TestCase extends Doctrine_Driver_UnitTestCase {
|
||||||
$this->pass();
|
$this->pass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function testSetIsolationExecutesSql() {
|
public function testSetIsolationExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('READ UNCOMMITTED');
|
$this->transaction->setIsolation('READ UNCOMMITTED');
|
||||||
$this->transaction->setIsolation('READ COMMITTED');
|
$this->transaction->setIsolation('READ COMMITTED');
|
||||||
$this->transaction->setIsolation('REPEATABLE READ');
|
$this->transaction->setIsolation('REPEATABLE READ');
|
||||||
|
@ -22,7 +53,8 @@ class Doctrine_Transaction_Mssql_TestCase extends Doctrine_Driver_UnitTestCase {
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
|
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED');
|
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED');
|
||||||
}
|
}
|
||||||
public function testSetIsolationSupportsSnapshotMode() {
|
public function testSetIsolationSupportsSnapshotMode()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('SNAPSHOT');
|
$this->transaction->setIsolation('SNAPSHOT');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL SNAPSHOT');
|
$this->assertEqual($this->adapter->pop(), 'SET TRANSACTION ISOLATION LEVEL SNAPSHOT');
|
||||||
|
|
|
@ -1,30 +1,64 @@
|
||||||
<?php
|
<?php
|
||||||
class Doctrine_Transaction_Mysql_TestCase extends Doctrine_Driver_UnitTestCase {
|
/*
|
||||||
public function __construct() {
|
* $Id$
|
||||||
parent::__construct('mysql');
|
*
|
||||||
}
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
public function testCreateSavePointExecutesSql() {
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* This software consists of voluntary contributions made by many individuals
|
||||||
|
* and is licensed under the LGPL. For more information, see
|
||||||
|
* <http://www.phpdoctrine.com>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Doctrine_Transaction_Mysql_TestCase
|
||||||
|
*
|
||||||
|
* @package Doctrine
|
||||||
|
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||||
|
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||||
|
* @category Object Relational Mapping
|
||||||
|
* @link www.phpdoctrine.com
|
||||||
|
* @since 1.0
|
||||||
|
* @version $Revision$
|
||||||
|
*/
|
||||||
|
class Doctrine_Transaction_Mysql_TestCase extends Doctrine_UnitTestCase
|
||||||
|
{
|
||||||
|
public function testCreateSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->beginTransaction('mypoint');
|
$this->transaction->beginTransaction('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testReleaseSavePointExecutesSql() {
|
public function testReleaseSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->commit('mypoint');
|
$this->transaction->commit('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testRollbackSavePointExecutesSql() {
|
public function testRollbackSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->beginTransaction('mypoint');
|
$this->transaction->beginTransaction('mypoint');
|
||||||
$this->transaction->rollback('mypoint');
|
$this->transaction->rollback('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testGetIsolationExecutesSql() {
|
public function testGetIsolationExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->getIsolation();
|
$this->transaction->getIsolation();
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SELECT @@tx_isolation');
|
$this->assertEqual($this->adapter->pop(), 'SELECT @@tx_isolation');
|
||||||
}
|
}
|
||||||
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode() {
|
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->transaction->setIsolation('unknown');
|
$this->transaction->setIsolation('unknown');
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
@ -32,7 +66,8 @@ class Doctrine_Transaction_Mysql_TestCase extends Doctrine_Driver_UnitTestCase {
|
||||||
$this->pass();
|
$this->pass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function testSetIsolationExecutesSql() {
|
public function testSetIsolationExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('READ UNCOMMITTED');
|
$this->transaction->setIsolation('READ UNCOMMITTED');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED');
|
$this->assertEqual($this->adapter->pop(), 'SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED');
|
||||||
|
|
|
@ -1,23 +1,56 @@
|
||||||
<?php
|
<?php
|
||||||
class Doctrine_Transaction_Oracle_TestCase extends Doctrine_Driver_UnitTestCase {
|
/*
|
||||||
public function __construct() {
|
* $Id$
|
||||||
parent::__construct('oci');
|
*
|
||||||
}
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
public function testCreateSavePointExecutesSql() {
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* This software consists of voluntary contributions made by many individuals
|
||||||
|
* and is licensed under the LGPL. For more information, see
|
||||||
|
* <http://www.phpdoctrine.com>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Doctrine_Transaction_Mysql_TestCase
|
||||||
|
*
|
||||||
|
* @package Doctrine
|
||||||
|
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||||
|
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||||
|
* @category Object Relational Mapping
|
||||||
|
* @link www.phpdoctrine.com
|
||||||
|
* @since 1.0
|
||||||
|
* @version $Revision$
|
||||||
|
*/
|
||||||
|
class Doctrine_Transaction_Oracle_TestCase extends Doctrine_UnitTestCase
|
||||||
|
{
|
||||||
|
public function testCreateSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->beginTransaction('mypoint');
|
$this->transaction->beginTransaction('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testReleaseSavePointAlwaysReturnsTrue() {
|
public function testReleaseSavePointAlwaysReturnsTrue()
|
||||||
|
{
|
||||||
$this->assertEqual($this->transaction->commit('mypoint'), true);
|
$this->assertEqual($this->transaction->commit('mypoint'), true);
|
||||||
}
|
}
|
||||||
public function testRollbackSavePointExecutesSql() {
|
public function testRollbackSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->beginTransaction('mypoint');
|
$this->transaction->beginTransaction('mypoint');
|
||||||
$this->transaction->rollback('mypoint');
|
$this->transaction->rollback('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode() {
|
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->transaction->setIsolation('unknown');
|
$this->transaction->setIsolation('unknown');
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
@ -25,7 +58,8 @@ class Doctrine_Transaction_Oracle_TestCase extends Doctrine_Driver_UnitTestCase
|
||||||
$this->pass();
|
$this->pass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function testSetIsolationExecutesSql() {
|
public function testSetIsolationExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('READ UNCOMMITTED');
|
$this->transaction->setIsolation('READ UNCOMMITTED');
|
||||||
$this->transaction->setIsolation('READ COMMITTED');
|
$this->transaction->setIsolation('READ COMMITTED');
|
||||||
$this->transaction->setIsolation('REPEATABLE READ');
|
$this->transaction->setIsolation('REPEATABLE READ');
|
||||||
|
|
|
@ -1,25 +1,58 @@
|
||||||
<?php
|
<?php
|
||||||
class Doctrine_Transaction_Pgsql_TestCase extends Doctrine_Driver_UnitTestCase {
|
/*
|
||||||
public function __construct() {
|
* $Id$
|
||||||
parent::__construct('pgsql');
|
*
|
||||||
}
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
public function testCreateSavePointExecutesSql() {
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* This software consists of voluntary contributions made by many individuals
|
||||||
|
* and is licensed under the LGPL. For more information, see
|
||||||
|
* <http://www.phpdoctrine.com>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Doctrine_Transaction_Pgsql_TestCase
|
||||||
|
*
|
||||||
|
* @package Doctrine
|
||||||
|
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||||
|
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||||
|
* @category Object Relational Mapping
|
||||||
|
* @link www.phpdoctrine.com
|
||||||
|
* @since 1.0
|
||||||
|
* @version $Revision$
|
||||||
|
*/
|
||||||
|
class Doctrine_Transaction_Pgsql_TestCase extends Doctrine_UnitTestCase
|
||||||
|
{
|
||||||
|
public function testCreateSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->beginTransaction('mypoint');
|
$this->transaction->beginTransaction('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testReleaseSavePointExecutesSql() {
|
public function testReleaseSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->commit('mypoint');
|
$this->transaction->commit('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'RELEASE SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testRollbackSavePointExecutesSql() {
|
public function testRollbackSavePointExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->beginTransaction('mypoint');
|
$this->transaction->beginTransaction('mypoint');
|
||||||
$this->transaction->rollback('mypoint');
|
$this->transaction->rollback('mypoint');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
|
$this->assertEqual($this->adapter->pop(), 'ROLLBACK TO SAVEPOINT mypoint');
|
||||||
}
|
}
|
||||||
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode() {
|
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->transaction->setIsolation('unknown');
|
$this->transaction->setIsolation('unknown');
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
@ -27,7 +60,8 @@ class Doctrine_Transaction_Pgsql_TestCase extends Doctrine_Driver_UnitTestCase {
|
||||||
$this->pass();
|
$this->pass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function testSetIsolationExecutesSql() {
|
public function testSetIsolationExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('READ UNCOMMITTED');
|
$this->transaction->setIsolation('READ UNCOMMITTED');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ UNCOMMITTED');
|
$this->assertEqual($this->adapter->pop(), 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ UNCOMMITTED');
|
||||||
|
|
|
@ -1,9 +1,39 @@
|
||||||
<?php
|
<?php
|
||||||
class Doctrine_Transaction_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase {
|
/*
|
||||||
public function __construct() {
|
* $Id$
|
||||||
parent::__construct('sqlite');
|
*
|
||||||
}
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode() {
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* This software consists of voluntary contributions made by many individuals
|
||||||
|
* and is licensed under the LGPL. For more information, see
|
||||||
|
* <http://www.phpdoctrine.com>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Doctrine_Transaction_Sqlite_TestCase
|
||||||
|
*
|
||||||
|
* @package Doctrine
|
||||||
|
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||||
|
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||||
|
* @category Object Relational Mapping
|
||||||
|
* @link www.phpdoctrine.com
|
||||||
|
* @since 1.0
|
||||||
|
* @version $Revision$
|
||||||
|
*/
|
||||||
|
class Doctrine_Transaction_Sqlite_TestCase extends Doctrine_UnitTestCase
|
||||||
|
{
|
||||||
|
public function testSetIsolationThrowsExceptionOnUnknownIsolationMode()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->transaction->setIsolation('unknown');
|
$this->transaction->setIsolation('unknown');
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
@ -11,7 +41,8 @@ class Doctrine_Transaction_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase
|
||||||
$this->pass();
|
$this->pass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function testSetIsolationExecutesSql() {
|
public function testSetIsolationExecutesSql()
|
||||||
|
{
|
||||||
$this->transaction->setIsolation('READ UNCOMMITTED');
|
$this->transaction->setIsolation('READ UNCOMMITTED');
|
||||||
$this->transaction->setIsolation('READ COMMITTED');
|
$this->transaction->setIsolation('READ COMMITTED');
|
||||||
$this->transaction->setIsolation('REPEATABLE READ');
|
$this->transaction->setIsolation('REPEATABLE READ');
|
||||||
|
|
Loading…
Add table
Reference in a new issue