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
cb1a71f1
Commit
cb1a71f1
authored
Jan 10, 2008
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed test cases to expect the || SQL standard syntax
parent
c6b6669a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
ExpressionTestCase.php
tests/ExpressionTestCase.php
+4
-5
QueryTestCase.php
tests/QueryTestCase.php
+7
-7
No files found.
tests/ExpressionTestCase.php
View file @
cb1a71f1
...
...
@@ -38,8 +38,8 @@ class Doctrine_Expression_TestCase extends Doctrine_UnitTestCase
public
function
testSavingWithAnExpression
()
{
$e
=
new
Doctrine_Expression
(
"
CONCAT('some', 'one')
"
);
$this
->
assertEqual
(
$e
->
getSql
(),
"
CONCAT('some', 'one')
"
);
$e
=
new
Doctrine_Expression
(
"
'some' || 'one'
"
);
$this
->
assertEqual
(
$e
->
getSql
(),
"
'some' || 'one'
"
);
$u
=
new
User
();
$u
->
name
=
$e
;
...
...
@@ -56,8 +56,7 @@ class Doctrine_Expression_TestCase extends Doctrine_UnitTestCase
public
function
testExpressionParserSupportsFunctionComposition
()
{
$e
=
new
Doctrine_Expression
(
"SUBSTRING(
CONCAT('some', 'one')
, 0, 3)"
);
$this
->
assertEqual
(
$e
->
getSql
(),
"SUBSTR(
CONCAT('some', 'one')
, 0, 3)"
);
$e
=
new
Doctrine_Expression
(
"SUBSTRING(
'some' || 'one'
, 0, 3)"
);
$this
->
assertEqual
(
$e
->
getSql
(),
"SUBSTR(
'some' || 'one'
, 0, 3)"
);
}
}
tests/QueryTestCase.php
View file @
cb1a71f1
...
...
@@ -30,7 +30,7 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Query_TestCase
extends
Doctrine_UnitTestCase
class
Doctrine_Query_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testGetQueryHookResetsTheManuallyAddedDqlParts
()
...
...
@@ -48,7 +48,7 @@ class Doctrine_Query_TestCase extends Doctrine_UnitTestCase
public
function
testParseClauseSupportsArithmeticOperators
()
{
$q
=
new
Doctrine_Query
();
$q
=
new
Doctrine_Query
();
$str
=
$q
->
parseClause
(
'2 + 3'
);
...
...
@@ -60,7 +60,7 @@ class Doctrine_Query_TestCase extends Doctrine_UnitTestCase
}
public
function
testParseClauseSupportsArithmeticOperatorsWithFunctions
()
{
$q
=
new
Doctrine_Query
();
$q
=
new
Doctrine_Query
();
$str
=
$q
->
parseClause
(
'ACOS(2) + 3'
);
...
...
@@ -69,7 +69,7 @@ class Doctrine_Query_TestCase extends Doctrine_UnitTestCase
public
function
testParseClauseSupportsArithmeticOperatorsWithParenthesis
()
{
$q
=
new
Doctrine_Query
();
$q
=
new
Doctrine_Query
();
$str
=
$q
->
parseClause
(
'(3 + 3)*3'
);
...
...
@@ -82,7 +82,7 @@ class Doctrine_Query_TestCase extends Doctrine_UnitTestCase
public
function
testParseClauseSupportsArithmeticOperatorsWithParenthesisAndFunctions
()
{
$q
=
new
Doctrine_Query
();
$q
=
new
Doctrine_Query
();
$str
=
$q
->
parseClause
(
'(3 + 3)*ACOS(3)'
);
...
...
@@ -95,11 +95,11 @@ class Doctrine_Query_TestCase extends Doctrine_UnitTestCase
public
function
testParseClauseSupportsComponentReferences
()
{
$q
=
new
Doctrine_Query
();
$q
=
new
Doctrine_Query
();
$q
->
from
(
'User u'
)
->
leftJoin
(
'u.Phonenumber p'
);
$q
->
getQuery
();
//Doctrine::dump($q->getCachedForm(array('foo' => 'bar')));
$this
->
assertEqual
(
$q
->
parseClause
(
"CONCAT('u.name', u.name)"
),
"
CONCAT('u.name', e.name)
"
);
$this
->
assertEqual
(
$q
->
parseClause
(
"CONCAT('u.name', u.name)"
),
"
'u.name' || e.name
"
);
}
}
class
MyQuery
extends
Doctrine_Query
...
...
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