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
e40a541b
Commit
e40a541b
authored
Jun 18, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
78e1ec97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
ExpressionTestCase.php
tests/Query/ExpressionTestCase.php
+19
-6
No files found.
tests/Query/ExpressionTestCase.php
View file @
e40a541b
...
...
@@ -30,18 +30,25 @@
* @link www.phpdoctrine.com
* @since 1.0
*/
class
Doctrine_Query_Expression_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testUnknownExpressionInSelectClauseThrowsException
()
{
class
Doctrine_Query_Expression_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testUnknownExpressionInSelectClauseThrowsException
()
{
$q
=
new
Doctrine_Query
();
try
{
$q
->
parseQuery
(
'SELECT SOMEUNKNOWNFUNC(u.name, " ", u.loginname) FROM User u'
);
$q
->
getQuery
();
$this
->
fail
();
}
catch
(
Doctrine_Query_Exception
$e
)
{
$this
->
pass
();
}
}
public
function
testUnknownColumnWithinFunctionInSelectClauseThrowsException
()
{
public
function
testUnknownColumnWithinFunctionInSelectClauseThrowsException
()
{
$q
=
new
Doctrine_Query
();
try
{
...
...
@@ -53,21 +60,27 @@ class Doctrine_Query_Expression_TestCase extends Doctrine_UnitTestCase {
$this
->
pass
();
}
}
public
function
testConcatIsSupportedInSelectClause
()
{
public
function
testConcatIsSupportedInSelectClause
()
{
$q
=
new
Doctrine_Query
();
$q
->
parseQuery
(
'SELECT CONCAT(u.name, u.loginname) FROM User u'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'SELECT CONCAT(e.name, e.loginname) AS e__0 FROM entity e WHERE (e.type = 0)'
);
}
public
function
testConcatInSelectClauseSupportsLiteralStrings
()
{
public
function
testConcatInSelectClauseSupportsLiteralStrings
()
{
$q
=
new
Doctrine_Query
();
$q
->
parseQuery
(
"SELECT CONCAT(u.name, 'The Man') FROM User u"
);
$this
->
assertEqual
(
$q
->
getQuery
(),
"SELECT CONCAT(e.name, 'The Man') AS e__0 FROM entity e WHERE (e.type = 0)"
);
}
public
function
testConcatInSelectClauseSupportsMoreThanTwoArgs
()
{
public
function
testConcatInSelectClauseSupportsMoreThanTwoArgs
()
{
$q
=
new
Doctrine_Query
();
$q
->
parseQuery
(
"SELECT CONCAT(u.name, 'The Man', u.loginname) FROM User u"
);
...
...
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