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
fb46481a
Commit
fb46481a
authored
Jun 25, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added namespaces for event constants
parent
efea8acc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
100 additions
and
51 deletions
+100
-51
Connection.php
lib/Doctrine/Connection.php
+10
-10
Statement.php
lib/Doctrine/Connection/Statement.php
+3
-3
UnitOfWork.php
lib/Doctrine/Connection/UnitOfWork.php
+4
-4
Event.php
lib/Doctrine/Event.php
+27
-17
Record.php
lib/Doctrine/Record.php
+32
-2
Transaction.php
lib/Doctrine/Transaction.php
+9
-3
ProfilerTestCase.php
tests/Connection/ProfilerTestCase.php
+15
-12
No files found.
lib/Doctrine/Connection.php
View file @
fb46481a
...
...
@@ -325,7 +325,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
return
false
;
}
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
CONNECT
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
CONN
_CONN
ECT
);
$this
->
getListener
()
->
preConnect
(
$event
);
...
...
@@ -571,7 +571,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
*/
public
function
fetchAll
(
$statement
,
array
$params
=
array
())
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
PDO
::
FETCH_ASSOC
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
Doctrine
::
FETCH_ASSOC
);
}
/**
* fetchOne
...
...
@@ -594,7 +594,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
*/
public
function
fetchRow
(
$statement
,
array
$params
=
array
())
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetch
(
PDO
::
FETCH_ASSOC
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetch
(
Doctrine
::
FETCH_ASSOC
);
}
/**
* fetchArray
...
...
@@ -605,7 +605,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
*/
public
function
fetchArray
(
$statement
,
array
$params
=
array
())
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetch
(
PDO
::
FETCH_NUM
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetch
(
Doctrine
::
FETCH_NUM
);
}
/**
* fetchColumn
...
...
@@ -617,7 +617,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
*/
public
function
fetchColumn
(
$statement
,
array
$params
=
array
(),
$colnum
=
0
)
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
PDO
::
FETCH_COLUMN
,
$colnum
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
Doctrine
::
FETCH_COLUMN
,
$colnum
);
}
/**
* fetchAssoc
...
...
@@ -628,7 +628,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
*/
public
function
fetchAssoc
(
$statement
,
array
$params
=
array
())
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
PDO
::
FETCH_ASSOC
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
Doctrine
::
FETCH_ASSOC
);
}
/**
* fetchBoth
...
...
@@ -639,7 +639,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
*/
public
function
fetchBoth
(
$statement
,
array
$params
=
array
())
{
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
PDO
::
FETCH_BOTH
);
return
$this
->
execute
(
$statement
,
$params
)
->
fetchAll
(
Doctrine
::
FETCH_BOTH
);
}
/**
* query
...
...
@@ -672,7 +672,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
{
$this
->
connect
();
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
PREPARE
,
$statement
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
CONN_
PREPARE
,
$statement
);
$this
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
prePrepare
(
$event
);
...
...
@@ -760,7 +760,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
$stmt
->
execute
(
$params
);
return
$stmt
;
}
else
{
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
QUERY
,
$query
,
$params
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
CONN_
QUERY
,
$query
,
$params
);
$this
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
preQuery
(
$event
);
...
...
@@ -795,7 +795,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
return
$stmt
->
rowCount
();
}
else
{
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_E
VENT
::
EXEC
,
$query
,
$params
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_E
vent
::
CONN_
EXEC
,
$query
,
$params
);
$this
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
preExec
(
$event
);
...
...
lib/Doctrine/Connection/Statement.php
View file @
fb46481a
...
...
@@ -213,7 +213,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
*/
public
function
execute
(
$params
=
null
)
{
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
EXECUTE
,
$this
->
_stmt
->
queryString
,
$params
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
STMT_
EXECUTE
,
$this
->
_stmt
->
queryString
,
$params
);
// print $this->_stmt->queryString . print_r($params, true) . "<br>";
$this
->
_conn
->
getListener
()
->
preExecute
(
$event
);
...
...
@@ -257,7 +257,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
$cursorOrientation
=
Doctrine
::
FETCH_ORI_NEXT
,
$cursorOffset
=
null
)
{
$event
=
new
Doctrine_Db_Event
(
$this
,
Doctrine_Event
::
FETCHALL
,
$this
->
_stmt
->
getQuery
());
$event
=
new
Doctrine_Db_Event
(
$this
,
Doctrine_Event
::
STMT_FETCH
,
$this
->
_stmt
->
getQuery
());
$event
->
fetchMode
=
$fetchMode
;
$event
->
cursorOrientation
=
$cursorOrientation
;
...
...
@@ -289,7 +289,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
public
function
fetchAll
(
$fetchMode
=
Doctrine
::
FETCH_BOTH
,
$columnIndex
=
null
)
{
$event
=
new
Doctrine_Db_Event
(
$this
,
Doctrine_Event
::
FETCHALL
,
$this
->
_stmt
->
getQuery
());
$event
=
new
Doctrine_Db_Event
(
$this
,
Doctrine_Event
::
STMT_
FETCHALL
,
$this
->
_stmt
->
getQuery
());
$event
->
fetchMode
=
$fetchMode
;
$event
->
columnIndex
=
$columnIndex
;
...
...
lib/Doctrine/Connection/UnitOfWork.php
View file @
fb46481a
...
...
@@ -139,7 +139,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
*/
public
function
save
(
Doctrine_Record
$record
)
{
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
SAVE
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
RECORD_
SAVE
);
$record
->
preSave
(
$event
);
...
...
@@ -176,7 +176,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
}
$this
->
conn
->
beginTransaction
();
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
DELETE
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
RECORD_
DELETE
);
$record
->
preDelete
(
$event
);
...
...
@@ -326,7 +326,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
*/
public
function
update
(
Doctrine_Record
$record
)
{
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
UPDATE
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
RECORD_
UPDATE
);
$record
->
preUpdate
(
$event
);
...
...
@@ -381,7 +381,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
public
function
insert
(
Doctrine_Record
$record
)
{
// listen the onPreInsert event
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
INSERT
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
RECORD_
INSERT
);
$record
->
preInsert
(
$event
);
...
...
lib/Doctrine/Event.php
View file @
fb46481a
...
...
@@ -32,23 +32,33 @@
class
Doctrine_Event
{
/**
* EVENT CODE CONSTANTS
*/
const
QUERY
=
1
;
const
EXEC
=
2
;
const
EXECUTE
=
3
;
const
PREPARE
=
4
;
const
BEGIN
=
5
;
const
COMMIT
=
6
;
const
ROLLBACK
=
7
;
const
CONNECT
=
8
;
const
FETCH
=
9
;
const
FETCHALL
=
10
;
const
DELETE
=
11
;
const
SAVE
=
12
;
const
UPDATE
=
13
;
const
INSERT
=
14
;
* CONNECTION EVENT CODES
*/
const
CONN_QUERY
=
1
;
const
CONN_EXEC
=
2
;
const
CONN_PREPARE
=
3
;
const
CONN_CONNECT
=
4
;
const
STMT_EXECUTE
=
10
;
const
STMT_FETCH
=
11
;
const
STMT_FETCHALL
=
12
;
const
TX_BEGIN
=
31
;
const
TX_COMMIT
=
32
;
const
TX_ROLLBACK
=
33
;
const
SAVEPOINT_CREATE
=
34
;
const
SAVEPOINT_ROLLBACK
=
35
;
const
SAVEPOINT_COMMIT
=
36
;
/**
* RECORD EVENT CODES
*/
const
RECORD_DELETE
=
21
;
const
RECORD_SAVE
=
22
;
const
RECORD_UPDATE
=
23
;
const
RECORD_INSERT
=
24
;
const
RECORD_SERIALIZE
=
25
;
const
RECORD_UNSERIALIZE
=
26
;
/**
* @var mixed $_invoker the handler which invoked this event
*/
...
...
lib/Doctrine/Record.php
View file @
fb46481a
...
...
@@ -275,6 +275,30 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
protected
function
validateOnInsert
()
{
}
/**
* Empty template method to provide concrete Record classes with the possibility
* to hook into the serializing procedure.
*/
public
function
preSerialize
(
$event
)
{
}
/**
* Empty template method to provide concrete Record classes with the possibility
* to hook into the serializing procedure.
*/
public
function
postSerialize
(
$event
)
{
}
/**
* Empty template method to provide concrete Record classes with the possibility
* to hook into the serializing procedure.
*/
public
function
preUnserialize
(
$event
)
{
}
/**
* Empty template method to provide concrete Record classes with the possibility
* to hook into the serializing procedure.
*/
public
function
postUnserialize
(
$event
)
{
}
/**
* Empty template method to provide concrete Record classes with the possibility
* to hook into the saving procedure.
...
...
@@ -447,7 +471,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
public
function
serialize
()
{
$this
->
_table
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onSleep
(
$this
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
SERIALIZE_RECORD
);
$this
->
preSerialize
(
$event
);
$vars
=
get_object_vars
(
$this
);
...
...
@@ -482,7 +508,11 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
}
return
serialize
(
$vars
);
$str
=
serialize
(
$vars
);
$this
->
postSerialize
(
$event
);
return
$str
;
}
/**
* unseralize
...
...
lib/Doctrine/Transaction.php
View file @
fb46481a
...
...
@@ -222,7 +222,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
$this
->
createSavePoint
(
$savepoint
);
}
else
{
if
(
$this
->
transactionLevel
==
0
)
{
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
BEGIN
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
TX_
BEGIN
);
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
preTransactionBegin
(
$event
);
...
...
@@ -267,7 +267,7 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
$this
->
releaseSavePoint
(
$savepoint
);
}
else
{
if
(
$this
->
transactionLevel
==
1
)
{
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
COMMIT
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
TX_
COMMIT
);
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
preTransactionCommit
(
$event
);
...
...
@@ -333,9 +333,15 @@ class Doctrine_Transaction extends Doctrine_Connection_Module
if
(
!
is_null
(
$savepoint
))
{
$this
->
transactionLevel
=
$this
->
removeSavePoints
(
$savepoint
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
ROLLBACK_SAVEPOINT
);
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
preSavepointRollback
(
$event
);
$this
->
rollbackSavePoint
(
$savepoint
);
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
postSavepointRollback
(
$event
);
}
else
{
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
ROLLBACK
);
$event
=
new
Doctrine_Event
(
$this
,
Doctrine_Event
::
TX_
ROLLBACK
);
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
preTransactionRollback
(
$event
);
...
...
tests/Connection/ProfilerTestCase.php
View file @
fb46481a
...
...
@@ -39,7 +39,7 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
{}
public
function
setUp
()
{}
public
function
testQuery
()
{
$this
->
conn
=
Doctrine_Manager
::
getInstance
()
->
openConnection
(
array
(
'sqlite::memory:'
));
...
...
@@ -52,7 +52,7 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
'CREATE TABLE test (id INT)'
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
EXEC
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
CONN_
EXEC
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
$this
->
assertEqual
(
$this
->
conn
->
count
(),
1
);
...
...
@@ -66,14 +66,14 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
$this
->
assertEqual
(
$event
->
getQuery
(),
'INSERT INTO test (id) VALUES (?)'
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
PREPARE
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
CONN_
PREPARE
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
$stmt
->
execute
(
array
(
1
));
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
'INSERT INTO test (id) VALUES (?)'
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
EXECUTE
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
STMT_
EXECUTE
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
$this
->
assertEqual
(
$this
->
conn
->
count
(),
2
);
...
...
@@ -85,13 +85,13 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
$stmt
=
$this
->
conn
->
prepare
(
'INSERT INTO test (id) VALUES (?)'
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
'INSERT INTO test (id) VALUES (?)'
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
PREPARE
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
CONN_
PREPARE
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
$stmt2
=
$this
->
conn
->
prepare
(
'INSERT INTO test (id) VALUES (?)'
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
'INSERT INTO test (id) VALUES (?)'
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
PREPARE
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
CONN_
PREPARE
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
/** TODO: strange errors here
$stmt->execute(array(1));
...
...
@@ -105,6 +105,7 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($this->conn->count(), 4);
*/
}
public
function
testExecuteStatementMultipleTimes
()
{
try
{
...
...
@@ -118,14 +119,15 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
}
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
'INSERT INTO test (id) VALUES (?)'
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
EXECUTE
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
STMT_
EXECUTE
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
'INSERT INTO test (id) VALUES (?)'
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
EXECUTE
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
STMT_
EXECUTE
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
}
public
function
testTransactionRollback
()
{
try
{
...
...
@@ -136,7 +138,7 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
}
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
null
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
BEGIN
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
TX_
BEGIN
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
try
{
...
...
@@ -148,9 +150,10 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
null
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
ROLLBACK
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
TX_
ROLLBACK
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
}
public
function
testTransactionCommit
()
{
try
{
...
...
@@ -161,7 +164,7 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
}
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
null
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
BEGIN
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
TX_
BEGIN
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
try
{
...
...
@@ -174,7 +177,7 @@ class Doctrine_Connection_Profiler_TestCase extends Doctrine_UnitTestCase
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getQuery
(),
null
);
$this
->
assertTrue
(
$this
->
profiler
->
lastEvent
()
->
hasEnded
());
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
COMMIT
);
$this
->
assertEqual
(
$this
->
profiler
->
lastEvent
()
->
getCode
(),
Doctrine_Event
::
TX_
COMMIT
);
$this
->
assertTrue
(
is_numeric
(
$this
->
profiler
->
lastEvent
()
->
getElapsedSecs
()));
}
}
...
...
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