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
b309933a
Commit
b309933a
authored
Dec 12, 2007
by
tamcy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit test case for #673
parent
467897da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
0 deletions
+72
-0
673TestCase.php
tests/Ticket/673TestCase.php
+71
-0
run.php
tests/run.php
+1
-0
No files found.
tests/Ticket/673TestCase.php
0 → 100644
View file @
b309933a
<?php
/**
* Doctrine_Ticket_673_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_673_TestCase
extends
Doctrine_UnitTestCase
{
public
function
prepareData
()
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'T673_Student'
);
parent
::
prepareTables
();
}
public
function
testTicket
()
{
$q
=
Doctrine_Query
::
create
()
->
update
(
'T673_Student s'
)
->
set
(
's.foo'
,
's.foo + 1'
)
->
where
(
's.id = 2'
);
$this
->
assertTrue
(
preg_match_all
(
'/(s_foo)/'
,
$q
->
getSql
(),
$m
)
===
2
);
$this
->
assertTrue
(
preg_match_all
(
'/(s_id)/'
,
$q
->
getSql
(),
$m
)
===
1
);
try
{
$q
->
execute
();
$this
->
pass
();
}
catch
(
Exception
$e
)
{
$this
->
fail
(
$e
->
__toString
());
}
$q
=
Doctrine_Query
::
create
()
->
delete
()
->
from
(
'T673_Student s'
)
->
where
(
's.name = ? AND s.foo < ?'
,
'foo'
,
3
);
var_dump
(
$q
->
getSql
());
$this
->
assertTrue
(
preg_match_all
(
'/(s_name)/'
,
$q
->
getSql
(),
$m
)
===
1
);
$this
->
assertTrue
(
preg_match_all
(
'/(s_foo)/'
,
$q
->
getSql
(),
$m
)
===
1
);
try
{
$q
->
execute
();
$this
->
pass
();
}
catch
(
Exception
$e
)
{
$this
->
fail
(
$e
->
__toString
());
}
}
}
class
T673_Student
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
setTableName
(
'T673_Student_record'
);
$this
->
hasColumn
(
's_id as id'
,
'varchar'
,
30
,
array
(
'primary'
=>
true
,));
$this
->
hasColumn
(
's_foo as foo'
,
'integer'
,
4
,
array
(
'notnull'
=>
true
));
$this
->
hasColumn
(
's_name as name'
,
'varchar'
,
50
,
array
());
}
}
tests/run.php
View file @
b309933a
...
...
@@ -23,6 +23,7 @@ $tickets->addTestCase(new Doctrine_Ticket_642_TestCase());
//If you write a ticket testcase add it here like shown above!
$tickets
->
addTestCase
(
new
Doctrine_Ticket_438_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_638_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_673_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