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
0833fc57
Commit
0833fc57
authored
Jun 17, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for Firebird and Mssql sequence drivers
parent
af09158d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
3 deletions
+54
-3
FirebirdTestCase.php
tests/Sequence/FirebirdTestCase.php
+22
-1
MssqlTestCase.php
tests/Sequence/MssqlTestCase.php
+30
-1
PgsqlTestCase.php
tests/Sequence/PgsqlTestCase.php
+2
-1
No files found.
tests/Sequence/FirebirdTestCase.php
View file @
0833fc57
...
...
@@ -30,5 +30,26 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Firebird_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Firebird_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testCurrIdExecutesSql
()
{
$this
->
sequence
->
currId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT GEN_ID(user_seq, 0) as the_value FROM RDB$DATABASE'
);
}
public
function
testNextIdExecutesSql
()
{
$id
=
$this
->
sequence
->
nextId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT GEN_ID(user_seq, 1) as the_value FROM RDB$DATABASE'
);
}
public
function
testLastInsertIdCallsPdoLevelEquivalent
()
{
$id
=
$this
->
sequence
->
lastInsertId
(
'user'
);
$this
->
assertEqual
(
$id
,
1
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'LAST_INSERT_ID()'
);
}
}
tests/Sequence/MssqlTestCase.php
View file @
0833fc57
...
...
@@ -30,5 +30,34 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Mssql_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Mssql_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testCurrIdExecutesSql
()
{
$id
=
$this
->
sequence
->
currId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DELETE FROM user_seq WHERE id < 0'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT @@IDENTITY'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT @@VERSION'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SET IDENTITY_INSERT user_seq ON INSERT INTO user_seq (id) VALUES (0)'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT COUNT(1) FROM user_seq'
);
}
public
function
testNextIdExecutesSql
()
{
$id
=
$this
->
sequence
->
nextId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DELETE FROM user_seq WHERE id < 0'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT @@IDENTITY'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT @@VERSION'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SET IDENTITY_INSERT user_seq ON INSERT INTO user_seq (id) VALUES (0)'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT COUNT(1) FROM user_seq'
);
}
public
function
testLastInsertIdCallsPdoLevelEquivalent
()
{
$id
=
$this
->
sequence
->
lastInsertId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT @@IDENTITY'
);
}
}
tests/Sequence/PgsqlTestCase.php
View file @
0833fc57
...
...
@@ -30,7 +30,8 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Pgsql_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Pgsql_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testCurrIdExecutesSql
()
{
$this
->
sequence
->
currId
(
'user'
);
...
...
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