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
c8d0a378
Commit
c8d0a378
authored
Jan 08, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated sequence driver test cases
parent
609a228d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
9 deletions
+38
-9
MysqlTestCase.php
tests/Sequence/MysqlTestCase.php
+8
-4
OracleTestCase.php
tests/Sequence/OracleTestCase.php
+22
-1
SqliteTestCase.php
tests/Sequence/SqliteTestCase.php
+8
-4
No files found.
tests/Sequence/MysqlTestCase.php
View file @
c8d0a378
...
@@ -30,13 +30,16 @@
...
@@ -30,13 +30,16 @@
* @since 1.0
* @since 1.0
* @version $Revision$
* @version $Revision$
*/
*/
class
Doctrine_Sequence_Mysql_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Mysql_TestCase
extends
Doctrine_UnitTestCase
public
function
testCurrIdExecutesSql
()
{
{
public
function
testCurrIdExecutesSql
()
{
$this
->
sequence
->
currId
(
'user'
);
$this
->
sequence
->
currId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT MAX(id) FROM user_seq'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT MAX(id) FROM user_seq'
);
}
}
public
function
testNextIdExecutesSql
()
{
public
function
testNextIdExecutesSql
()
{
$id
=
$this
->
sequence
->
nextId
(
'user'
);
$id
=
$this
->
sequence
->
nextId
(
'user'
);
$this
->
assertEqual
(
$id
,
1
);
$this
->
assertEqual
(
$id
,
1
);
...
@@ -45,7 +48,8 @@ class Doctrine_Sequence_Mysql_TestCase extends Doctrine_UnitTestCase {
...
@@ -45,7 +48,8 @@ class Doctrine_Sequence_Mysql_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'LAST_INSERT_ID()'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'LAST_INSERT_ID()'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'INSERT INTO user_seq (id) VALUES (NULL)'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'INSERT INTO user_seq (id) VALUES (NULL)'
);
}
}
public
function
testLastInsertIdCallsPdoLevelEquivalent
()
{
public
function
testLastInsertIdCallsPdoLevelEquivalent
()
{
$id
=
$this
->
sequence
->
lastInsertId
(
'user'
);
$id
=
$this
->
sequence
->
lastInsertId
(
'user'
);
$this
->
assertEqual
(
$id
,
1
);
$this
->
assertEqual
(
$id
,
1
);
...
...
tests/Sequence/OracleTestCase.php
View file @
c8d0a378
...
@@ -30,5 +30,26 @@
...
@@ -30,5 +30,26 @@
* @since 1.0
* @since 1.0
* @version $Revision$
* @version $Revision$
*/
*/
class
Doctrine_Sequence_Oracle_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Oracle_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testCurrIdExecutesSql
()
{
$this
->
sequence
->
currId
(
'user'
);
$q
=
"SELECT (last_number-1) FROM user_sequences WHERE sequence_name='user_seq' OR sequence_name='USER_SEQ'"
;
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
$q
);
}
public
function
testNextIdExecutesSql
()
{
$id
=
$this
->
sequence
->
nextId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT user_seq.nextval FROM DUAL'
);
}
public
function
testLastInsertIdExecutesSql
()
{
$this
->
sequence
->
lastInsertId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT user_seq.currval'
);
}
}
}
tests/Sequence/SqliteTestCase.php
View file @
c8d0a378
...
@@ -30,13 +30,16 @@
...
@@ -30,13 +30,16 @@
* @since 1.0
* @since 1.0
* @version $Revision$
* @version $Revision$
*/
*/
class
Doctrine_Sequence_Sqlite_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Sqlite_TestCase
extends
Doctrine_UnitTestCase
public
function
testCurrIdExecutesSql
()
{
{
public
function
testCurrIdExecutesSql
()
{
$this
->
sequence
->
currId
(
'user'
);
$this
->
sequence
->
currId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT MAX(id) FROM user_seq'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT MAX(id) FROM user_seq'
);
}
}
public
function
testNextIdExecutesSql
()
{
public
function
testNextIdExecutesSql
()
{
$id
=
$this
->
sequence
->
nextId
(
'user'
);
$id
=
$this
->
sequence
->
nextId
(
'user'
);
$this
->
assertEqual
(
$id
,
1
);
$this
->
assertEqual
(
$id
,
1
);
...
@@ -45,7 +48,8 @@ class Doctrine_Sequence_Sqlite_TestCase extends Doctrine_UnitTestCase {
...
@@ -45,7 +48,8 @@ class Doctrine_Sequence_Sqlite_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'LAST_INSERT_ID()'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'LAST_INSERT_ID()'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'INSERT INTO user_seq (id) VALUES (NULL)'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'INSERT INTO user_seq (id) VALUES (NULL)'
);
}
}
public
function
testLastInsertIdCallsPdoLevelEquivalent
()
{
public
function
testLastInsertIdCallsPdoLevelEquivalent
()
{
$id
=
$this
->
sequence
->
lastInsertId
(
'user'
);
$id
=
$this
->
sequence
->
lastInsertId
(
'user'
);
$this
->
assertEqual
(
$id
,
1
);
$this
->
assertEqual
(
$id
,
1
);
...
...
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