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
ad21df55
Commit
ad21df55
authored
Jun 25, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
74884356
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
53 deletions
+56
-53
EventListenerTestCase.php
tests/EventListenerTestCase.php
+42
-43
TableTestCase.php
tests/TableTestCase.php
+2
-2
UnitTestCase.php
tests/UnitTestCase.php
+4
-4
run.php
tests/run.php
+8
-4
No files found.
tests/EventListenerTestCase.php
View file @
ad21df55
...
...
@@ -30,46 +30,17 @@
* @since 1.0
* @version $Revision$
*/
class
EventListenerTest
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
"name"
,
"string"
,
100
);
$this
->
hasColumn
(
"password"
,
"string"
,
8
);
}
public
function
setUp
()
{
//$this->attribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_AccessorInvoker());
}
public
function
getName
(
$name
)
{
return
strtoupper
(
$name
);
}
public
function
setPassword
(
$password
)
{
return
md5
(
$password
);
}
}
class
Doctrine_EventListener_TestLogger
implements
Doctrine_Overloadable
,
Countable
{
private
$messages
=
array
();
public
function
__call
(
$m
,
$a
)
{
$this
->
messages
[]
=
$m
;
}
public
function
pop
()
{
return
array_pop
(
$this
->
messages
);
}
public
function
clear
()
{
$this
->
messages
=
array
();
}
public
function
getAll
()
{
return
$this
->
messages
;
}
public
function
count
()
{
return
count
(
$this
->
messages
);
}
}
class
Doctrine_EventListener_TestCase
extends
Doctrine_UnitTestCase
{
private
$logger
;
public
function
prepareData
()
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'EventListenerTest'
);
parent
::
prepareTables
();
}
public
function
testSetListener
()
{
$this
->
logger
=
new
Doctrine_EventListener_TestLogger
();
...
...
@@ -82,6 +53,7 @@ class Doctrine_EventListener_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$e
->
getTable
()
->
getListener
(),
$this
->
logger
);
}
/**
public function testOnLoad() {
$this->logger->clear();
$this->assertEqual($this->connection->getTable('EventListenerTest')->getListener(), $this->logger);
...
...
@@ -200,14 +172,41 @@ class Doctrine_EventListener_TestCase extends Doctrine_UnitTestCase {
$this->connection->setListener(new Doctrine_EventListener());
}
*/
}
class
EventListenerTest
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
"name"
,
"string"
,
100
);
$this
->
hasColumn
(
"password"
,
"string"
,
8
);
}
public
function
setUp
()
{
//$this->attribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_AccessorInvoker());
}
public
function
getName
(
$name
)
{
return
strtoupper
(
$name
);
}
public
function
setPassword
(
$password
)
{
return
md5
(
$password
);
}
}
class
Doctrine_EventListener_TestLogger
implements
Doctrine_Overloadable
,
Countable
{
private
$messages
=
array
();
public
function
__call
(
$m
,
$a
)
{
public
function
prepareData
()
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'EventListenerTest'
);
parent
::
prepareTables
();
$this
->
messages
[]
=
$m
;
}
public
function
pop
()
{
return
array_pop
(
$this
->
messages
);
}
public
function
clear
()
{
$this
->
messages
=
array
();
}
public
function
getAll
()
{
return
$this
->
messages
;
}
public
function
count
()
{
return
count
(
$this
->
messages
);
}
}
?>
tests/TableTestCase.php
View file @
ad21df55
tests/UnitTestCase.php
View file @
ad21df55
...
...
@@ -130,7 +130,7 @@ class Doctrine_UnitTestCase extends UnitTestCase
}
catch
(
Doctrine_Manager_Exception
$e
)
{
if
(
$this
->
driverName
==
'main'
)
{
$this
->
dbh
=
array
(
'sqlite::memory:'
);
$this
->
dbh
=
new
PDO
(
'sqlite::memory:'
);
}
else
{
$this
->
dbh
=
$this
->
adapter
=
new
Doctrine_Adapter_Mock
(
$this
->
driverName
);
}
...
...
@@ -243,7 +243,7 @@ class Doctrine_UnitTestCase extends UnitTestCase
$users
[
7
]
->
Phonenumber
[
0
]
->
phonenumber
=
'111 567 333'
;
$this
->
users
=
$users
;
$this
->
connection
->
flush
();
$this
->
users
->
save
();
}
public
function
getConnection
()
{
...
...
tests/run.php
View file @
ad21df55
...
...
@@ -72,7 +72,7 @@ $test = new GroupTest('Doctrine Framework Unit Tests');
$test->addTestCase(new Doctrine_Ticket330_TestCase());
*/
/**
*/
/**
// Connection drivers (not yet fully tested)
$test->addTestCase(new Doctrine_Connection_Pgsql_TestCase());
$test->addTestCase(new Doctrine_Connection_Oracle_TestCase());
...
...
@@ -150,7 +150,7 @@ $test->addTestCase(new Doctrine_Expression_Oracle_TestCase());
$test->addTestCase(new Doctrine_Expression_Sqlite_TestCase());
// Core
*/
$test
->
addTestCase
(
new
Doctrine_Access_TestCase
());
//$test->addTestCase(new Doctrine_Configurable_TestCase());
...
...
@@ -264,6 +264,10 @@ $test->addTestCase(new Doctrine_Query_Orderby_TestCase());
$test
->
addTestCase
(
new
Doctrine_Query_Subquery_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Query_Driver_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Record_Hook_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Query_AggregateValue_TestCase
());
...
...
@@ -295,9 +299,9 @@ $test->addTestCase(new Doctrine_Query_JoinCondition_TestCase());
$test
->
addTestCase
(
new
Doctrine_Query_MultipleAggregateValue_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Query_TestCase
());
/**
/** */
//$test->addTestCase(new Doctrine_IntegrityAction_TestCase());
*/
//$test->addTestCase(new Doctrine_AuditLog_TestCase());
// Cache tests
...
...
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