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
902d609f
Commit
902d609f
authored
Sep 03, 2007
by
jackbravo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed one unnecesary class, more to go
parent
94cb373b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
28 deletions
+9
-28
ExpressionTest.php
models/ExpressionTest.php
+0
-9
ExpressionTestCase.php
tests/ExpressionTestCase.php
+9
-19
No files found.
models/ExpressionTest.php
deleted
100644 → 0
View file @
94cb373b
<?php
class
ExpressionTest
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'name'
,
'string'
);
$this
->
hasColumn
(
'amount'
,
'integer'
);
}
}
tests/ExpressionTestCase.php
View file @
902d609f
...
...
@@ -32,41 +32,31 @@
*/
class
Doctrine_Expression_TestCase
extends
Doctrine_UnitTestCase
{
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'ExpressionTest'
);
parent
::
prepareTables
();
}
public
function
prepareData
()
{
}
public
function
testSavingWithAnExpression
()
{
$e
=
new
ExpressionTest
();
$e
->
name
=
new
Doctrine_Expression
(
"CONCAT('some', 'one')"
);
$e
->
save
();
$e
->
refresh
();
$this
->
assertEqual
(
$e
->
name
,
'someone'
);
$e
=
new
Doctrine_Expression
(
"CONCAT('some', 'one')"
);
$this
->
assertEqual
(
$e
->
getSql
(),
"CONCAT('some', 'one')"
);
$u
=
new
User
();
$u
->
name
=
$e
;
$u
->
save
();
$u
->
refresh
();
$this
->
assertEqual
(
$u
->
name
,
'someone'
);
}
public
function
testExpressionParserSupportsNumericalClauses
()
{
$e
=
new
Doctrine_Expression
(
'1 + 2'
);
$this
->
assertEqual
(
$e
->
getSql
(),
'1 + 2'
);
}
public
function
testExpressionParserSupportsFunctionComposition
()
{
$e
=
new
Doctrine_Expression
(
"SUBSTRING(CONCAT('some', 'one'), 0, 3)"
);
$this
->
assertEqual
(
$e
->
getSql
(),
"SUBSTR(CONCAT('some', 'one'), 0, 3)"
);
}
}
...
...
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