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
617213b8
Commit
617213b8
authored
Sep 24, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed tests
parent
96177e3e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
31 deletions
+14
-31
EventListener.php
Doctrine/EventListener.php
+2
-2
EventListenerChainTestCase.php
tests/EventListenerChainTestCase.php
+7
-13
EventListenerTestCase.php
tests/EventListenerTestCase.php
+4
-0
RecordTestCase.php
tests/RecordTestCase.php
+0
-15
TableTestCase.php
tests/TableTestCase.php
+1
-1
No files found.
Doctrine/EventListener.php
View file @
617213b8
...
...
@@ -29,7 +29,7 @@ Doctrine::autoload('Doctrine_EventListener_Interface');
* @url www.phpdoctrine.com
* @license LGPL
*/
abstract
class
Doctrine_EventListener
implements
Doctrine_EventListener_Interface
{
class
Doctrine_EventListener
implements
Doctrine_EventListener_Interface
{
public
function
onLoad
(
Doctrine_Record
$record
)
{
}
public
function
onPreLoad
(
Doctrine_Record
$record
)
{
}
...
...
@@ -79,4 +79,4 @@ abstract class Doctrine_EventListener implements Doctrine_EventListener_Interfac
public
function
onCollectionDelete
(
Doctrine_Collection
$collection
)
{
}
public
function
onPreCollectionDelete
(
Doctrine_Collection
$collection
)
{
}
}
}
tests/EventListenerChainTestCase.php
View file @
617213b8
...
...
@@ -24,28 +24,22 @@ class Doctrine_EventListener_TestB extends Doctrine_EventListener {
}
class
Doctrine_EventListener_Chain_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testEvents
()
{
$connection
=
$this
->
manager
->
openConnection
(
Doctrine_DB
::
getConn
(
"sqlite::memory:"
));
$debug
=
$this
->
listener
->
getMessages
();
$last
=
end
(
$debug
);
$this
->
assertTrue
(
$last
->
getObject
()
instanceof
Doctrine_Connection
);
$this
->
assertTrue
(
$last
->
getCode
()
==
Doctrine_EventListener_Debugger
::
EVENT_OPEN
);
}
public
function
testAccessorInvokerChain
()
{
$e
=
new
EventListenerTest
;
$e
=
new
EventListener
Chain
Test
;
$e
->
name
=
"something"
;
$this
->
assertEqual
(
$e
->
get
(
'name'
),
'
SOMETHING
'
);
$this
->
assertEqual
(
$e
->
get
(
'name'
),
'
somethingTestATestB
'
);
// test repeated calls
$this
->
assertEqual
(
$e
->
get
(
'name'
),
'
SOMETHING
'
);
$this
->
assertEqual
(
$e
->
get
(
'name'
),
'
somethingTestATestB
'
);
$this
->
assertEqual
(
$e
->
id
,
null
);
$this
->
assertEqual
(
$e
->
rawGet
(
'name'
),
'something'
);
$e
->
save
();
$this
->
assertEqual
(
$e
->
id
,
1
);
$this
->
assertEqual
(
$e
->
name
,
'
SOMETHING
'
);
$this
->
assertEqual
(
$e
->
name
,
'
somethingTestATestB
'
);
$this
->
assertEqual
(
$e
->
rawGet
(
'name'
),
'something'
);
$this
->
connection
->
clear
();
...
...
@@ -53,7 +47,7 @@ class Doctrine_EventListener_Chain_TestCase extends Doctrine_UnitTestCase {
$e
->
refresh
();
$this
->
assertEqual
(
$e
->
id
,
1
);
$this
->
assertEqual
(
$e
->
name
,
'
SOMETHING
'
);
$this
->
assertEqual
(
$e
->
name
,
'
somethingTestATestB
'
);
$this
->
assertEqual
(
$e
->
rawGet
(
'name'
),
'something'
);
$this
->
connection
->
clear
();
...
...
@@ -61,7 +55,7 @@ class Doctrine_EventListener_Chain_TestCase extends Doctrine_UnitTestCase {
$e
=
$e
->
getTable
()
->
find
(
$e
->
id
);
$this
->
assertEqual
(
$e
->
id
,
1
);
$this
->
assertEqual
(
$e
->
name
,
'
SOMETHING
'
);
$this
->
assertEqual
(
$e
->
name
,
'
somethingTestATestB
'
);
$this
->
assertEqual
(
$e
->
rawGet
(
'name'
),
'something'
);
}
public
function
prepareData
()
{
}
...
...
tests/EventListenerTestCase.php
View file @
617213b8
...
...
@@ -195,8 +195,12 @@ class Doctrine_EventListenerTestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$this
->
logger
->
pop
(),
'onPreDelete'
);
$this
->
assertEqual
(
$this
->
logger
->
pop
(),
'onTransactionBegin'
);
$this
->
assertEqual
(
$this
->
logger
->
pop
(),
'onPreTransactionBegin'
);
$this
->
connection
->
setListener
(
new
Doctrine_EventListener
());
}
public
function
prepareData
()
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'EventListenerTest'
);
...
...
tests/RecordTestCase.php
View file @
617213b8
...
...
@@ -690,21 +690,6 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$user
->
getModified
(),
array
());
$this
->
assertEqual
(
$user
->
name
,
"Jack Daniels"
);
$debug
=
$this
->
listener
->
getMessages
();
$p
=
array_pop
(
$debug
);
$this
->
assertTrue
(
$p
->
getObject
()
instanceof
Doctrine_Connection
);
$this
->
assertTrue
(
$p
->
getCode
()
==
Doctrine_EventListener_Debugger
::
EVENT_COMMIT
);
$p
=
array_pop
(
$debug
);
$this
->
assertTrue
(
$p
->
getObject
()
instanceof
Doctrine_Record
);
$this
->
assertTrue
(
$p
->
getCode
()
==
Doctrine_EventListener_Debugger
::
EVENT_SAVE
);
$p
=
array_pop
(
$debug
);
$this
->
assertTrue
(
$p
->
getObject
()
instanceof
Doctrine_Record
);
$this
->
assertTrue
(
$p
->
getCode
()
==
Doctrine_EventListener_Debugger
::
EVENT_UPDATE
);
}
public
function
testCopy
()
{
$user
=
$this
->
connection
->
getTable
(
"User"
)
->
find
(
4
);
...
...
tests/TableTestCase.php
View file @
617213b8
...
...
@@ -82,7 +82,7 @@ class Doctrine_TableTestCase extends Doctrine_UnitTestCase {
$this
->
assertTrue
(
$fk
->
getType
()
==
Doctrine_Relation
::
MANY_COMPOSITE
);
$this
->
assertTrue
(
$fk
->
getLocal
()
==
$this
->
objTable
->
getIdentifier
());
$this
->
assertTrue
(
$fk
->
getForeign
()
==
"entity_id"
);
}
public
function
testGetComponentName
()
{
...
...
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