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
4516678f
Commit
4516678f
authored
Dec 15, 2007
by
tamcy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test case for #626 regarding Doctrine_Table->find()
parent
2af9fb80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
626DTestCase.php
tests/Ticket/626DTestCase.php
+58
-0
run.php
tests/run.php
+1
-0
No files found.
tests/Ticket/626DTestCase.php
0 → 100644
View file @
4516678f
<?php
/**
* Doctrine_Ticket_626D_TestCase
*
* @package Doctrine
* @author Tamcy <7am.online@gmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Ticket_626D_TestCase
extends
Doctrine_UnitTestCase
{
public
function
prepareData
()
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'T626D_Student1'
);
parent
::
prepareTables
();
}
protected
function
newStudent
(
$cls
,
$id
,
$name
)
{
$u
=
new
$cls
;
$u
->
id
=
$id
;
$u
->
name
=
$name
;
$u
->
save
();
return
$u
;
}
public
function
testFieldNames
()
{
$student1
=
$this
->
newStudent
(
'T626D_Student1'
,
'07090002'
,
'First Student'
);
try
{
$student
=
Doctrine
::
getTable
(
'T626D_Student1'
)
->
find
(
'07090002'
);
$this
->
pass
();
}
catch
(
Exception
$e
)
{
$this
->
fail
(
$e
->
__toString
());
}
}
}
class
T626D_Student1
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
setTableName
(
'T626D_Student_record_1'
);
$this
->
hasColumn
(
's_id as id'
,
'varchar'
,
30
,
array
(
'primary'
=>
true
,));
$this
->
hasColumn
(
's_name as name'
,
'varchar'
,
50
,
array
());
}
}
tests/run.php
View file @
4516678f
...
...
@@ -24,6 +24,7 @@ $tickets->addTestCase(new Doctrine_Ticket_642_TestCase());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_438_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_638_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_673_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_626D_TestCase
());
$test
->
addTestCase
(
$tickets
);
// Connection drivers (not yet fully tested)
...
...
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