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
54801dde
Commit
54801dde
authored
May 31, 2006
by
doctrine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
1c81cb30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
5 deletions
+24
-5
Record.php
Doctrine/Record.php
+3
-2
QueryTestCase.class.php
tests/QueryTestCase.class.php
+17
-1
RecordTestCase.class.php
tests/RecordTestCase.class.php
+2
-0
run.php
tests/run.php
+2
-2
No files found.
Doctrine/Record.php
View file @
54801dde
...
...
@@ -1111,11 +1111,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
public
function
__call
(
$m
,
$a
)
{
if
(
!
function_exists
(
$m
))
throw
new
Doctrine_Record_Exception
(
"unknown callback"
);
throw
new
Doctrine_Record_Exception
(
"unknown callback
'
$m
'
"
);
if
(
isset
(
$a
[
0
]))
{
$column
=
$a
[
0
];
$this
->
data
[
$column
]
=
$m
(
$this
->
get
(
$column
));
$a
[
0
]
=
$this
->
get
(
$column
);
$this
->
data
[
$column
]
=
call_user_func_array
(
$m
,
$a
);
}
return
$this
;
}
...
...
tests/QueryTestCase.class.php
View file @
54801dde
...
...
@@ -7,6 +7,23 @@ class Doctrine_QueryTestCase extends Doctrine_UnitTestCase {
$this
->
tables
[]
=
"Forum_Thread"
;
parent
::
prepareTables
();
}
public
function
testImmediateFetching
()
{
$count
=
$this
->
dbh
->
count
();
$this
->
session
->
getTable
(
'User'
)
->
clear
();
$this
->
session
->
getTable
(
'Email'
)
->
clear
();
$this
->
session
->
getTable
(
'Phonenumber'
)
->
clear
();
$users
=
$this
->
query
->
from
(
"User-i.Email-i"
)
->
execute
();
$this
->
assertEqual
((
$count
+
1
),
$this
->
dbh
->
count
());
$this
->
assertEqual
(
count
(
$users
),
8
);
$this
->
assertEqual
(
get_class
(
$users
[
0
]
->
Email
),
'Email'
);
$this
->
assertEqual
((
$count
+
1
),
$this
->
dbh
->
count
());
$this
->
assertEqual
(
$users
[
0
]
->
Email
->
address
,
'zYne@example.com'
);
$this
->
assertEqual
((
$count
+
1
),
$this
->
dbh
->
count
());
}
public
function
testLazyPropertyFetchingWithMultipleColumns
()
{
$q
=
new
Doctrine_Query
(
$this
->
session
);
...
...
@@ -52,7 +69,6 @@ class Doctrine_QueryTestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$count
,
count
(
$this
->
dbh
));
$this
->
assertTrue
(
is_numeric
(
$users
[
2
]
->
email_id
));
$this
->
assertEqual
(
$count
,
count
(
$this
->
dbh
));
}
public
function
testMultipleFetching
()
{
...
...
tests/RecordTestCase.class.php
View file @
54801dde
...
...
@@ -7,6 +7,8 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$user
->
name
=
" zYne "
;
$user
->
trim
(
'name'
);
$this
->
assertEqual
(
$user
->
name
,
'zYne'
);
$user
->
substr
(
'name'
,
0
,
1
);
$this
->
assertEqual
(
$user
->
name
,
'z'
);
}
public
function
testJoinTableSelfReferencing
()
{
$e
=
new
Entity
();
...
...
tests/run.php
View file @
54801dde
...
...
@@ -25,7 +25,7 @@ $test = new GroupTest("Doctrine Framework Unit Tests");
//$test->addTestCase(new Sensei_UnitTestCase());
$test
->
addTestCase
(
new
Doctrine_RecordTestCase
());
/**
$test
->
addTestCase
(
new
Doctrine_SessionTestCase
());
$test
->
addTestCase
(
new
Doctrine_TableTestCase
());
...
...
@@ -47,7 +47,7 @@ $test->addTestCase(new Doctrine_Collection_OffsetTestCase());
$test
->
addTestCase
(
new
Doctrine_CollectionTestCase
());
$test
->
addTestCase
(
new
Doctrine_QueryTestCase
());
*/
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());
...
...
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