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
bd46df21
Commit
bd46df21
authored
Jan 07, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
af0d91fe
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
53 additions
and
63 deletions
+53
-63
DriverTestCase.php
tests/DriverTestCase.php
+9
-2
Db2.php
tests/Sequence/Db2.php
+0
-36
FirebirdTestCase.php
tests/Sequence/FirebirdTestCase.php
+1
-3
InformixTestCase.php
tests/Sequence/InformixTestCase.php
+1
-3
MssqlTestCase.php
tests/Sequence/MssqlTestCase.php
+1
-3
MysqlTestCase.php
tests/Sequence/MysqlTestCase.php
+21
-2
OracleTestCase.php
tests/Sequence/OracleTestCase.php
+1
-3
PgsqlTestCase.php
tests/Sequence/PgsqlTestCase.php
+1
-3
SqliteTestCase.php
tests/Sequence/SqliteTestCase.php
+1
-3
UnitTestCase.php
tests/UnitTestCase.php
+1
-0
run.php
tests/run.php
+16
-5
No files found.
tests/DriverTestCase.php
View file @
bd46df21
...
...
@@ -57,7 +57,11 @@ class AdapterMock implements Doctrine_Adapter_Interface {
return
0
;
}
public
function
lastInsertId
(){
}
public
function
lastInsertId
()
{
$this
->
queries
[]
=
'LAST_INSERT_ID()'
;
return
1
;
}
public
function
beginTransaction
(){
$this
->
queries
[]
=
'BEGIN TRANSACTION'
;
}
...
...
@@ -67,7 +71,7 @@ class AdapterMock implements Doctrine_Adapter_Interface {
public
function
rollBack
(){
}
public
function
errorCode
(){
}
public
function
errorInfo
(){
}
public
function
getAttribute
(
$attribute
)
{
public
function
getAttribute
(
$attribute
)
{
if
(
$attribute
==
PDO
::
ATTR_DRIVER_NAME
)
return
strtolower
(
$this
->
name
);
}
...
...
@@ -85,6 +89,9 @@ class AdapterStatementMock {
public
function
execute
()
{
return
true
;
}
public
function
fetchColumn
(
$colnum
)
{
return
0
;
}
}
class
Doctrine_Driver_UnitTestCase
extends
UnitTestCase
{
...
...
tests/Sequence/Db2.php
deleted
100644 → 0
View file @
af0d91fe
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Sequence_Db2_TestCase
*
* @package Doctrine
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Db2_TestCase
extends
Doctrine_UnitTestCase
{
}
tests/Sequence/Firebird.php
→
tests/Sequence/Firebird
TestCase
.php
View file @
bd46df21
...
...
@@ -30,7 +30,5 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Firebird_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Firebird_TestCase
extends
Doctrine_UnitTestCase
{
}
tests/Sequence/Informix.php
→
tests/Sequence/Informix
TestCase
.php
View file @
bd46df21
...
...
@@ -30,7 +30,5 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Informix_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Informix_TestCase
extends
Doctrine_UnitTestCase
{
}
tests/Sequence/Mssql.php
→
tests/Sequence/Mssql
TestCase
.php
View file @
bd46df21
...
...
@@ -30,7 +30,5 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Mssql_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Mssql_TestCase
extends
Doctrine_UnitTestCase
{
}
tests/Sequence/Mysql.php
→
tests/Sequence/Mysql
TestCase
.php
View file @
bd46df21
...
...
@@ -30,7 +30,26 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Mysql_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Mysql_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testCurrIdExecutesSql
()
{
$this
->
sequence
->
currId
(
'user'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'SELECT MAX(id) FROM user_seq'
);
}
public
function
testNextIdExecutesSql
()
{
$id
=
$this
->
sequence
->
nextId
(
'user'
);
$this
->
assertEqual
(
$id
,
1
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DELETE FROM user_seq WHERE id < 1'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'LAST_INSERT_ID()'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'INSERT INTO user_seq (id) VALUES (NULL)'
);
}
public
function
testLastInsertIdCallsPdoLevelEquivalent
()
{
$id
=
$this
->
sequence
->
lastInsertId
(
'user'
);
$this
->
assertEqual
(
$id
,
1
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'LAST_INSERT_ID()'
);
}
}
tests/Sequence/Oracle.php
→
tests/Sequence/Oracle
TestCase
.php
View file @
bd46df21
...
...
@@ -30,7 +30,5 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Oracle_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Oracle_TestCase
extends
Doctrine_UnitTestCase
{
}
tests/Sequence/Pgsql.php
→
tests/Sequence/Pgsql
TestCase
.php
View file @
bd46df21
...
...
@@ -30,7 +30,5 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Pgsql_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Pgsql_TestCase
extends
Doctrine_UnitTestCase
{
}
tests/Sequence/Sqlite.php
→
tests/Sequence/Sqlite
TestCase
.php
View file @
bd46df21
...
...
@@ -30,7 +30,5 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Sequence_Sqlite_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Sequence_Sqlite_TestCase
extends
Doctrine_UnitTestCase
{
}
tests/UnitTestCase.php
View file @
bd46df21
...
...
@@ -114,6 +114,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
$this
->
transaction
=
$this
->
connection
->
transaction
;
$this
->
dataDict
=
$this
->
connection
->
dataDict
;
$this
->
expr
=
$this
->
connection
->
expression
;
$this
->
sequence
=
$this
->
connection
->
sequence
;
}
$this
->
unitOfWork
=
$this
->
connection
->
unitOfWork
;
$this
->
connection
->
setListener
(
new
Doctrine_EventListener
());
...
...
tests/run.php
View file @
bd46df21
...
...
@@ -54,10 +54,10 @@ print '<pre>';
$test
=
new
GroupTest
(
'Doctrine Framework Unit Tests'
);
$test
->
addTestCase
(
new
Doctrine_Sequence_Mysql_TestCase
());
// DATABASE ABSTRACTION tests
/**
// Connection drivers (not yet fully tested)
$test->addTestCase(new Doctrine_Connection_Pgsql_TestCase());
$test->addTestCase(new Doctrine_Connection_Oracle_TestCase());
...
...
@@ -87,6 +87,16 @@ $test->addTestCase(new Doctrine_DataDict_Pgsql_TestCase());
$test->addTestCase(new Doctrine_DataDict_Oracle_TestCase());
$test->addTestCase(new Doctrine_DataDict_Sqlite_TestCase());
// Sequence module (not yet fully tested)
$test->addTestCase(new Doctrine_Sequence_TestCase());
$test->addTestCase(new Doctrine_Sequence_Firebird_TestCase());
$test->addTestCase(new Doctrine_Sequence_Informix_TestCase());
$test->addTestCase(new Doctrine_Sequence_Mssql_TestCase());
$test->addTestCase(new Doctrine_Sequence_Pgsql_TestCase());
$test->addTestCase(new Doctrine_Sequence_Oracle_TestCase());
$test->addTestCase(new Doctrine_Sequence_Sqlite_TestCase());
// Export module (not yet fully tested)
$test->addTestCase(new Doctrine_Export_TestCase());
$test->addTestCase(new Doctrine_Export_Reporter_TestCase());
...
...
@@ -136,6 +146,9 @@ $test->addTestCase(new Doctrine_Collection_TestCase());
$test->addTestCase(new Doctrine_Relation_TestCase());
$test->addTestCase(new Doctrine_Relation_Access_TestCase());
$test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase());
$test->addTestCase(new Doctrine_Relation_OneToOne_TestCase());
$test->addTestCase(new Doctrine_TreeStructure_TestCase());
// Datatypes
...
...
@@ -193,9 +206,7 @@ $test->addTestCase(new Doctrine_Query_Expression_TestCase());
$test->addTestCase(new Doctrine_Query_Having_TestCase());
$test->addTestCase(new Doctrine_Query_JoinCondition_TestCase());
$test
->
addTestCase
(
new
Doctrine_TreeStructure_TestCase
());
*/
// Cache tests
//$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase());
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
...
...
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