Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
cab5b432
Commit
cab5b432
authored
Nov 30, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated transaction drivers
parent
ddc9c326
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
97 additions
and
68 deletions
+97
-68
Interface.php
lib/Doctrine/Adapter/Interface.php
+7
-2
Connection.php
lib/Doctrine/Connection.php
+3
-3
Transaction.php
lib/Doctrine/Transaction.php
+50
-20
Firebird.php
lib/Doctrine/Transaction/Firebird.php
+3
-3
Mysql.php
lib/Doctrine/Transaction/Mysql.php
+3
-3
Oracle.php
lib/Doctrine/Transaction/Oracle.php
+3
-3
Pgsql.php
lib/Doctrine/Transaction/Pgsql.php
+3
-3
TransactionFirebirdTestCase.php
tests/TransactionFirebirdTestCase.php
+5
-5
TransactionMysqlTestCase.php
tests/TransactionMysqlTestCase.php
+4
-4
TransactionOracleTestCase.php
tests/TransactionOracleTestCase.php
+3
-3
TransactionPgsqlTestCase.php
tests/TransactionPgsqlTestCase.php
+3
-3
TransactionTestCase.php
tests/TransactionTestCase.php
+10
-16
No files found.
lib/Doctrine/Adapter/Interface.php
View file @
cab5b432
...
...
@@ -20,10 +20,15 @@
*/
/**
* Doctrine_Adapter_Interface
* This adapter interface should be implemented by all custom adapters
*
* @author Konsta Vesterinen
* @license LGPL
* @author Konsta Vesterinen
<kvesteri@cc.hut.fi>
* @license
http://www.opensource.org/licenses/lgpl-license.php
LGPL
* @package Doctrine
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
interface
Doctrine_Adapter_Interface
{
public
function
prepare
(
$prepareString
);
...
...
lib/Doctrine/Connection.php
View file @
cab5b432
...
...
@@ -357,11 +357,11 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
* @throws Doctrine_Connection_Exception if some of the key values was null
* @throws Doctrine_Connection_Exception if there were no key fields
* @throws PDOException if something fails at PDO level
* @return
voi
d
* @return
integer number of rows affecte
d
*/
public
function
replace
(
$table
,
array
$fields
,
array
$keys
)
{
if
(
!
$this
->
supports
(
'replace'
))
throw
new
Doctrine_Connection_Exception
(
'replace query is not supported'
);
//
if( ! $this->supports('replace'))
//
throw new Doctrine_Connection_Exception('replace query is not supported');
if
(
empty
(
$keys
))
...
...
lib/Doctrine/Transaction.php
View file @
cab5b432
...
...
@@ -43,7 +43,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
*/
const
STATE_BUSY
=
2
;
/**
* @var integer $transaction
_l
evel the nesting level of transactions, used by transaction methods
* @var integer $transaction
L
evel the nesting level of transactions, used by transaction methods
*/
protected
$transactionLevel
=
0
;
/**
...
...
@@ -55,6 +55,10 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
* this list will be deleted when transaction is committed
*/
protected
$delete
=
array
();
/**
* @var array $savepoints an array containing all savepoints
*/
public
$savePoints
=
array
();
/**
* getState
* returns the state of this connection
...
...
@@ -148,27 +152,27 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
* beginTransaction
* Start a transaction or set a savepoint.
*
* if trying to set a savepoint and there is no active transaction
* a new transaction is being started
*
* Listeners: onPreTransactionBegin, onTransactionBegin
*
* @param string $savepoint name of a savepoint to set
* @throws Doctrine_Transaction_Exception if trying to create a savepoint and there
* are no active transactions
*
* @return integer current transaction nesting level
*/
public
function
beginTransaction
(
$savepoint
=
null
)
{
if
(
!
is_null
(
$savepoint
))
{
$this
->
beginTransaction
();
$this
->
savePoints
[]
=
$savepoint
;
if
(
!
is_null
(
$savepoint
))
{
if
(
$this
->
transactionLevel
==
0
)
throw
new
Doctrine_Transaction_Exception
(
'Savepoint cannot be created when changes are auto committed'
);
$this
->
createSavePoint
(
$savepoint
);
}
else
{
if
(
$this
->
transactionLevel
==
0
)
{
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onPreTransactionBegin
(
$this
->
conn
);
$this
->
conn
->
getDbh
()
->
beginTransaction
();
$this
->
conn
->
getDbh
()
->
beginTransaction
();
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onTransactionBegin
(
$this
->
conn
);
}
...
...
@@ -189,18 +193,21 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
*
* @param string $savepoint name of a savepoint to release
* @throws Doctrine_Transaction_Exception if the transaction fails at PDO level
* @throws Doctrine_Transaction_Exception if there are no active transactions
* @throws Doctrine_Validator_Exception if the transaction fails due to record validations
* @return
void
* @return
boolean false if commit couldn't be performed, true otherwise
*/
public
function
commit
(
$savepoint
=
null
)
{
if
(
$this
->
transactionLevel
==
0
)
throw
new
Doctrine_Transaction_Exception
(
'Commit/release savepoint cannot be done. There is no active transaction.'
);
return
false
;
$this
->
transactionLevel
--
;
if
(
!
is_null
(
$savepoint
))
{
$this
->
transactionLevel
=
$this
->
removeSavePoints
(
$savepoint
);
$this
->
releaseSavePoint
(
$savepoint
);
}
else
{
$this
->
transactionLevel
--
;
if
(
$this
->
transactionLevel
==
0
)
{
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onPreTransactionCommit
(
$this
->
conn
);
...
...
@@ -230,6 +237,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onTransactionCommit
(
$this
->
conn
);
}
}
return
true
;
}
/**
* rollback
...
...
@@ -242,16 +250,18 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
* eventlistener methods
*
* @param string $savepoint name of a savepoint to rollback to
* @throws Doctrine_Transaction_Exception if there are no active transactions
* @return void
* @return boolean false if rollback couldn't be performed, true otherwise
*/
public
function
rollback
(
$savepoint
=
null
)
{
//
if($this->transactionLevel == 0)
// throw new Doctrine_Transaction_Exception('Rollback cannot be done. There is no active transaction.')
;
if
(
$this
->
transactionLevel
==
0
)
return
false
;
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onPreTransactionRollback
(
$this
->
conn
);
if
(
!
is_null
(
$savepoint
))
{
if
(
!
is_null
(
$savepoint
))
{
$this
->
transactionLevel
=
$this
->
removeSavePoints
(
$savepoint
);
$this
->
rollbackSavePoint
(
$savepoint
);
}
else
{
//$this->conn->unitOfWork->reset();
...
...
@@ -262,6 +272,8 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
$this
->
conn
->
getDbh
()
->
rollback
();
}
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onTransactionRollback
(
$this
->
conn
);
return
true
;
}
/**
* releaseSavePoint
...
...
@@ -270,7 +282,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
* @param string $savepoint name of a savepoint to create
* @return void
*/
p
ublic
function
createSavePoint
(
$savepoint
)
{
p
rotected
function
createSavePoint
(
$savepoint
)
{
throw
new
Doctrine_Transaction_Exception
(
'Savepoints not supported by this driver.'
);
}
/**
...
...
@@ -280,7 +292,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
* @param string $savepoint name of a savepoint to release
* @return void
*/
p
ublic
function
releaseSavePoint
(
$savepoint
)
{
p
rotected
function
releaseSavePoint
(
$savepoint
)
{
throw
new
Doctrine_Transaction_Exception
(
'Savepoints not supported by this driver.'
);
}
/**
...
...
@@ -290,9 +302,27 @@ class Doctrine_Transaction extends Doctrine_Connection_Module {
* @param string $savepoint name of a savepoint to rollback to
* @return void
*/
p
ublic
function
rollbackSavePoint
(
$savepoint
)
{
p
rotected
function
rollbackSavePoint
(
$savepoint
)
{
throw
new
Doctrine_Transaction_Exception
(
'Savepoints not supported by this driver.'
);
}
/**
* removeSavePoints
* removes a savepoint from the internal savePoints array of this transaction object
* and all its children savepoints
*
* @param sring $savepoint name of the savepoint to remove
* @return integer the current transaction level
*/
private
function
removeSavePoints
(
$savepoint
)
{
$i
=
array_search
(
$savepoint
,
$this
->
savePoints
);
$c
=
count
(
$this
->
savePoints
);
for
(
$x
=
$i
;
$x
<
count
(
$this
->
savePoints
);
$x
++
)
{
unset
(
$this
->
savePoints
[
$x
]);
}
return
(
$c
-
$i
);
}
/**
* setIsolation
*
...
...
lib/Doctrine/Transaction/Firebird.php
View file @
cab5b432
...
...
@@ -38,7 +38,7 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to set
* @return void
*/
p
ublic
function
createSavePoint
(
$savepoint
)
{
p
rotected
function
createSavePoint
(
$savepoint
)
{
$query
=
'SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
@@ -50,7 +50,7 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to release
* @return void
*/
p
ublic
function
releaseSavePoint
(
$savepoint
)
{
p
rotected
function
releaseSavePoint
(
$savepoint
)
{
$query
=
'RELEASE SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
@@ -62,7 +62,7 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to rollback to
* @return void
*/
p
ublic
function
rollbackSavePoint
(
$savepoint
)
{
p
rotected
function
rollbackSavePoint
(
$savepoint
)
{
$query
=
'ROLLBACK TO SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
lib/Doctrine/Transaction/Mysql.php
View file @
cab5b432
...
...
@@ -38,7 +38,7 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to set
* @return void
*/
p
ublic
function
createSavePoint
(
$savepoint
)
{
p
rotected
function
createSavePoint
(
$savepoint
)
{
$query
=
'SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
@@ -50,7 +50,7 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to release
* @return void
*/
p
ublic
function
releaseSavePoint
(
$savepoint
)
{
p
rotected
function
releaseSavePoint
(
$savepoint
)
{
$query
=
'RELEASE SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
@@ -62,7 +62,7 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to rollback to
* @return void
*/
p
ublic
function
rollbackSavePoint
(
$savepoint
)
{
p
rotected
function
rollbackSavePoint
(
$savepoint
)
{
$query
=
'ROLLBACK TO SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
lib/Doctrine/Transaction/Oracle.php
View file @
cab5b432
...
...
@@ -38,7 +38,7 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to set
* @return void
*/
p
ublic
function
createSavePoint
(
$savepoint
)
{
p
rotected
function
createSavePoint
(
$savepoint
)
{
$query
=
'SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
@@ -50,7 +50,7 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to release
* @return void
*/
p
ublic
function
releaseSavePoint
(
$savepoint
)
{
p
rotected
function
releaseSavePoint
(
$savepoint
)
{
// oracle doesn't support manual releasing of savepoints
return
true
;
}
...
...
@@ -61,7 +61,7 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to rollback to
* @return void
*/
p
ublic
function
rollbackSavePoint
(
$savepoint
)
{
p
rotected
function
rollbackSavePoint
(
$savepoint
)
{
$query
=
'ROLLBACK TO SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
lib/Doctrine/Transaction/Pgsql.php
View file @
cab5b432
...
...
@@ -39,7 +39,7 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to set
* @return void
*/
p
ublic
function
createSavePoint
(
$savepoint
)
{
p
rotected
function
createSavePoint
(
$savepoint
)
{
$query
=
'SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
@@ -51,7 +51,7 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to release
* @return void
*/
p
ublic
function
releaseSavePoint
(
$savepoint
)
{
p
rotected
function
releaseSavePoint
(
$savepoint
)
{
$query
=
'RELEASE SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
@@ -63,7 +63,7 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction {
* @param string $savepoint name of a savepoint to rollback to
* @return void
*/
p
ublic
function
rollbackSavePoint
(
$savepoint
)
{
p
rotected
function
rollbackSavePoint
(
$savepoint
)
{
$query
=
'ROLLBACK TO SAVEPOINT '
.
$savepoint
;
return
$this
->
conn
->
getDbh
()
->
query
(
$query
);
...
...
tests/TransactionFirebirdTestCase.php
View file @
cab5b432
...
...
@@ -4,17 +4,17 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas
parent
::
__construct
(
'firebird'
);
}
public
function
testCreateSavePointExecutesSql
()
{
$this
->
transaction
->
createSavePoint
(
'mypoint'
);
$this
->
transaction
->
beginTransaction
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SAVEPOINT mypoint'
);
}
public
function
testReleaseSavePointExecutesSql
()
{
$this
->
transaction
->
releaseSavePoin
t
(
'mypoint'
);
$this
->
transaction
->
commi
t
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'RELEASE SAVEPOINT mypoint'
);
}
public
function
testRollbackSavePointExecutesSql
()
{
$this
->
transaction
->
rollback
SavePoint
(
'mypoint'
);
$this
->
transaction
->
rollback
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'ROLLBACK TO SAVEPOINT mypoint'
);
}
...
...
@@ -46,7 +46,7 @@ class Doctrine_Transaction_Firebird_TestCase extends Doctrine_Driver_UnitTestCas
$this
->
transaction
->
setIsolation
(
'READ UNCOMMITTED'
);
$this
->
transaction
->
setIsolation
(
'READ COMMITTED'
);
$this
->
transaction
->
setIsolation
(
'REPEATABLE READ'
);
$this
->
transaction
->
setIsolation
(
'SERIALIZABLE'
);
$this
->
transaction
->
setIsolation
(
'SERIALIZABLE'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SET TRANSACTION ISOLATION LEVEL SNAPSHOT TABLE STABILITY'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SET TRANSACTION ISOLATION LEVEL SNAPSHOT'
);
...
...
tests/TransactionMysqlTestCase.php
View file @
cab5b432
...
...
@@ -4,17 +4,17 @@ class Doctrine_Transaction_Mysql_TestCase extends Doctrine_Driver_UnitTestCase {
parent
::
__construct
(
'mysql'
);
}
public
function
testCreateSavePointExecutesSql
()
{
$this
->
transaction
->
createSavePoint
(
'mypoint'
);
$this
->
transaction
->
beginTransaction
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SAVEPOINT mypoint'
);
}
public
function
testReleaseSavePointExecutesSql
()
{
$this
->
transaction
->
releaseSavePoin
t
(
'mypoint'
);
$this
->
transaction
->
commi
t
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'RELEASE SAVEPOINT mypoint'
);
}
public
function
testRollbackSavePointExecutesSql
()
{
$this
->
transaction
->
rollback
SavePoint
(
'mypoint'
);
$this
->
transaction
->
rollback
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'ROLLBACK TO SAVEPOINT mypoint'
);
}
...
...
tests/TransactionOracleTestCase.php
View file @
cab5b432
...
...
@@ -4,15 +4,15 @@ class Doctrine_Transaction_Oracle_TestCase extends Doctrine_Driver_UnitTestCase
parent
::
__construct
(
'oci'
);
}
public
function
testCreateSavePointExecutesSql
()
{
$this
->
transaction
->
createSavePoint
(
'mypoint'
);
$this
->
transaction
->
beginTransaction
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SAVEPOINT mypoint'
);
}
public
function
testReleaseSavePointAlwaysReturnsTrue
()
{
$this
->
assertEqual
(
$this
->
transaction
->
releaseSavePoin
t
(
'mypoint'
),
true
);
$this
->
assertEqual
(
$this
->
transaction
->
commi
t
(
'mypoint'
),
true
);
}
public
function
testRollbackSavePointExecutesSql
()
{
$this
->
transaction
->
rollback
SavePoint
(
'mypoint'
);
$this
->
transaction
->
rollback
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'ROLLBACK TO SAVEPOINT mypoint'
);
}
...
...
tests/TransactionPgsqlTestCase.php
View file @
cab5b432
...
...
@@ -4,17 +4,17 @@ class Doctrine_Transaction_Pgsql_TestCase extends Doctrine_Driver_UnitTestCase {
parent
::
__construct
(
'pgsql'
);
}
public
function
testCreateSavePointExecutesSql
()
{
$this
->
transaction
->
createSavePoint
(
'mypoint'
);
$this
->
transaction
->
beginTransaction
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SAVEPOINT mypoint'
);
}
public
function
testReleaseSavePointExecutesSql
()
{
$this
->
transaction
->
releaseSavePoin
t
(
'mypoint'
);
$this
->
transaction
->
commi
t
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'RELEASE SAVEPOINT mypoint'
);
}
public
function
testRollbackSavePointExecutesSql
()
{
$this
->
transaction
->
rollback
SavePoint
(
'mypoint'
);
$this
->
transaction
->
rollback
(
'mypoint'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'ROLLBACK TO SAVEPOINT mypoint'
);
}
...
...
tests/TransactionTestCase.php
View file @
cab5b432
...
...
@@ -3,9 +3,10 @@ class Doctrine_Transaction_TestCase extends Doctrine_Driver_UnitTestCase {
public
function
__construct
()
{
parent
::
__construct
(
'sqlite'
,
true
);
}
/**
public function testCreateSavepointIsOnlyImplementedAtDriverLevel() {
try {
$this
->
transaction
->
createSavePoint
(
'point'
);
$this->transaction->
beginTransaction
('point');
$this->fail();
} catch(Doctrine_Transaction_Exception $e) {
$this->pass();
...
...
@@ -13,15 +14,18 @@ class Doctrine_Transaction_TestCase extends Doctrine_Driver_UnitTestCase {
}
public function testReleaseSavepointIsOnlyImplementedAtDriverLevel() {
try {
$this
->
transaction
->
releaseSavePoin
t
(
'point'
);
$this->transaction->
commi
t('point');
$this->fail();
} catch(Doctrine_Transaction_Exception $e) {
$this->pass();
}
}
*/
public
function
testRollbackSavepointIsOnlyImplementedAtDriverLevel
()
{
try
{
$this
->
transaction
->
rollbackSavePoint
(
'point'
);
$this
->
transaction
->
beginTransaction
();
$this
->
transaction
->
rollback
(
'point'
);
$this
->
fail
();
}
catch
(
Doctrine_Transaction_Exception
$e
)
{
$this
->
pass
();
...
...
@@ -49,21 +53,11 @@ class Doctrine_Transaction_TestCase extends Doctrine_Driver_UnitTestCase {
public
function
testGetStateReturnsStateConstant
()
{
$this
->
assertEqual
(
$this
->
transaction
->
getState
(),
Doctrine_Transaction
::
STATE_SLEEP
);
}
public
function
testExceptionIsThrownWhenCommittingNotActiveTransaction
()
{
try
{
$this
->
transaction
->
commit
();
$this
->
fail
();
}
catch
(
Doctrine_Transaction_Exception
$e
)
{
$this
->
pass
();
}
public
function
testCommittingNotActiveTransactionReturnsFalse
()
{
$this
->
assertEqual
(
$this
->
transaction
->
commit
(),
false
);
}
public
function
testExceptionIsThrownWhenUsingRollbackOnNotActiveTransaction
()
{
try
{
$this
->
transaction
->
rollback
();
$this
->
fail
();
}
catch
(
Doctrine_Transaction_Exception
$e
)
{
$this
->
pass
();
}
$this
->
assertEqual
(
$this
->
transaction
->
rollback
(),
false
);
}
public
function
testBeginTransactionStartsNewTransaction
()
{
$this
->
transaction
->
beginTransaction
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment