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
1c81cb30
Commit
1c81cb30
authored
May 30, 2006
by
doctrine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
2e5c96df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
Record.php
Doctrine/Record.php
+15
-0
RecordTestCase.class.php
tests/RecordTestCase.class.php
+6
-1
run.php
tests/run.php
+2
-2
No files found.
Doctrine/Record.php
View file @
1c81cb30
...
...
@@ -1104,6 +1104,21 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
final
public
function
hasColumn
(
$name
,
$type
,
$length
=
20
,
$options
=
""
)
{
$this
->
table
->
setColumn
(
$name
,
$type
,
$length
,
$options
);
}
/**
* __call
* @param string $m
* @param array $a
*/
public
function
__call
(
$m
,
$a
)
{
if
(
!
function_exists
(
$m
))
throw
new
Doctrine_Record_Exception
(
"unknown callback"
);
if
(
isset
(
$a
[
0
]))
{
$column
=
$a
[
0
];
$this
->
data
[
$column
]
=
$m
(
$this
->
get
(
$column
));
}
return
$this
;
}
/**
* returns a string representation of this object
*/
...
...
tests/RecordTestCase.class.php
View file @
1c81cb30
...
...
@@ -2,7 +2,12 @@
require_once
(
"UnitTestCase.class.php"
);
class
Doctrine_RecordTestCase
extends
Doctrine_UnitTestCase
{
public
function
testCallback
()
{
$user
=
new
User
();
$user
->
name
=
" zYne "
;
$user
->
trim
(
'name'
);
$this
->
assertEqual
(
$user
->
name
,
'zYne'
);
}
public
function
testJoinTableSelfReferencing
()
{
$e
=
new
Entity
();
$e
->
name
=
"Entity test"
;
...
...
tests/run.php
View file @
1c81cb30
...
...
@@ -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