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
a2016e2e
Commit
a2016e2e
authored
Mar 01, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
80093d7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
DeleteTestCase.php
tests/Query/DeleteTestCase.php
+10
-10
No files found.
tests/Query/DeleteTestCase.php
View file @
a2016e2e
...
...
@@ -5,65 +5,65 @@ class Doctrine_Query_Delete_TestCase extends Doctrine_UnitTestCase {
$q
->
parseQuery
(
'DELETE FROM User'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
WHERE (e.type = 0)'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity WHERE (e.type = 0)'
);
$q
=
new
Doctrine_Query
();
$q
->
delete
()
->
from
(
'User'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
WHERE (e.type = 0)'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity WHERE (e.type = 0)'
);
}
public
function
testDeleteAll
()
{
$q
=
new
Doctrine_Query
();
$q
->
parseQuery
(
'DELETE FROM Entity'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity'
);
$q
=
new
Doctrine_Query
();
$q
->
delete
()
->
from
(
'Entity'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity'
);
}
public
function
testDeleteWithCondition
()
{
$q
=
new
Doctrine_Query
();
$q
->
parseQuery
(
'DELETE FROM Entity WHERE id = 3'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
WHERE id = 3'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity WHERE id = 3'
);
$q
=
new
Doctrine_Query
();
$q
->
delete
()
->
from
(
'Entity'
)
->
where
(
'id = 3'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
WHERE id = 3'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity WHERE id = 3'
);
}
public
function
testDeleteWithLimit
()
{
$q
=
new
Doctrine_Query
();
$q
->
parseQuery
(
'DELETE FROM Entity LIMIT 20'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
LIMIT 20'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity LIMIT 20'
);
$q
=
new
Doctrine_Query
();
$q
->
delete
()
->
from
(
'Entity'
)
->
limit
(
20
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
LIMIT 20'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity LIMIT 20'
);
}
public
function
testDeleteWithLimitAndOffset
()
{
$q
=
new
Doctrine_Query
();
$q
->
parseQuery
(
'DELETE FROM Entity LIMIT 10 OFFSET 20'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
LIMIT 10 OFFSET 20'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity LIMIT 10 OFFSET 20'
);
$q
=
new
Doctrine_Query
();
$q
->
delete
()
->
from
(
'Entity'
)
->
limit
(
10
)
->
offset
(
20
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity
e
LIMIT 10 OFFSET 20'
);
$this
->
assertEqual
(
$q
->
getQuery
(),
'DELETE FROM entity LIMIT 10 OFFSET 20'
);
}
}
?>
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