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
b8257aad
Commit
b8257aad
authored
Nov 28, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated datadict driver test cases
parent
570bc068
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
27 deletions
+62
-27
FirebirdTestCase.php
tests/DataDict/FirebirdTestCase.php
+10
-10
MssqlTestCase.php
tests/DataDict/MssqlTestCase.php
+9
-9
run.php
tests/run.php
+43
-8
No files found.
tests/DataDict/Firebird.php
→
tests/DataDict/Firebird
TestCase
.php
View file @
b8257aad
...
...
@@ -6,7 +6,7 @@ class Doctrine_DataDict_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
public
function
testGetNativeDefinitionSupportsIntegerType
()
{
$a
=
array
(
'type'
=>
'integer'
,
'length'
=>
20
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
BIG
INT'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'INT'
);
$a
[
'length'
]
=
4
;
...
...
@@ -14,18 +14,18 @@ class Doctrine_DataDict_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
$a
[
'length'
]
=
2
;
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
SMALL
INT'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'INT'
);
}
public
function
testGetNativeDefinitionSupportsFloatType
()
{
$a
=
array
(
'type'
=>
'float'
,
'length'
=>
20
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'DOUBLE'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'DOUBLE
PRECISION
'
);
}
public
function
testGetNativeDefinitionSupportsBooleanType
()
{
$a
=
array
(
'type'
=>
'boolean'
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
TINYINT(1)
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
SMALLINT
'
);
}
public
function
testGetNativeDefinitionSupportsDateType
()
{
$a
=
array
(
'type'
=>
'date'
,
'fixed'
=>
false
);
...
...
@@ -35,7 +35,7 @@ class Doctrine_DataDict_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
public
function
testGetNativeDefinitionSupportsTimestampType
()
{
$a
=
array
(
'type'
=>
'timestamp'
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
DATETIME
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
TIMESTAMP
'
);
}
public
function
testGetNativeDefinitionSupportsTimeType
()
{
$a
=
array
(
'type'
=>
'time'
,
'fixed'
=>
false
);
...
...
@@ -45,12 +45,12 @@ class Doctrine_DataDict_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
public
function
testGetNativeDefinitionSupportsClobType
()
{
$a
=
array
(
'type'
=>
'clob'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
LONGTEXT
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
BLOB SUB_TYPE 1
'
);
}
public
function
testGetNativeDefinitionSupportsBlobType
()
{
$a
=
array
(
'type'
=>
'blob'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
LONGBLOB
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
BLOB SUB_TYPE 0
'
);
}
public
function
testGetNativeDefinitionSupportsCharType
()
{
$a
=
array
(
'type'
=>
'char'
,
'length'
=>
10
);
...
...
@@ -70,16 +70,16 @@ class Doctrine_DataDict_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
public
function
testGetNativeDefinitionSupportsStringType
()
{
$a
=
array
(
'type'
=>
'string'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
TEXT
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
VARCHAR(16777215)
'
);
}
public
function
testGetNativeDefinitionSupportsArrayType2
()
{
$a
=
array
(
'type'
=>
'array'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
TEXT
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
VARCHAR(16777215)
'
);
}
public
function
testGetNativeDefinitionSupportsObjectType
()
{
$a
=
array
(
'type'
=>
'object'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
TEXT
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
VARCHAR(16777215)
'
);
}
}
tests/DataDict/MssqlTestCase.php
View file @
b8257aad
...
...
@@ -6,7 +6,7 @@ class Doctrine_DataDict_Mssql_TestCase extends Doctrine_Driver_UnitTestCase {
public
function
testGetNativeDefinitionSupportsIntegerType
()
{
$a
=
array
(
'type'
=>
'integer'
,
'length'
=>
20
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
BIG
INT'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'INT'
);
$a
[
'length'
]
=
4
;
...
...
@@ -14,43 +14,43 @@ class Doctrine_DataDict_Mssql_TestCase extends Doctrine_Driver_UnitTestCase {
$a
[
'length'
]
=
2
;
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
SMALL
INT'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'INT'
);
}
public
function
testGetNativeDefinitionSupportsFloatType
()
{
$a
=
array
(
'type'
=>
'float'
,
'length'
=>
20
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
DOUBLE
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
FLOAT
'
);
}
public
function
testGetNativeDefinitionSupportsBooleanType
()
{
$a
=
array
(
'type'
=>
'boolean'
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
TINYINT(1)
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
BIT
'
);
}
public
function
testGetNativeDefinitionSupportsDateType
()
{
$a
=
array
(
'type'
=>
'date'
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
DATE
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
CHAR(10)
'
);
}
public
function
testGetNativeDefinitionSupportsTimestampType
()
{
$a
=
array
(
'type'
=>
'timestamp'
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
DATETIME
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
CHAR(19)
'
);
}
public
function
testGetNativeDefinitionSupportsTimeType
()
{
$a
=
array
(
'type'
=>
'time'
,
'fixed'
=>
false
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
TIME
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
CHAR(8)
'
);
}
public
function
testGetNativeDefinitionSupportsClobType
()
{
$a
=
array
(
'type'
=>
'clob'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
LONG
TEXT'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'TEXT'
);
}
public
function
testGetNativeDefinitionSupportsBlobType
()
{
$a
=
array
(
'type'
=>
'blob'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
LONGBLOB
'
);
$this
->
assertEqual
(
$this
->
dataDict
->
getNativeDeclaration
(
$a
),
'
IMAGE
'
);
}
public
function
testGetNativeDefinitionSupportsCharType
()
{
$a
=
array
(
'type'
=>
'char'
,
'length'
=>
10
);
...
...
tests/run.php
View file @
b8257aad
...
...
@@ -60,11 +60,45 @@ require_once('BooleanTestCase.php');
require_once
(
'EnumTestCase.php'
);
require_once
(
'DataDictSqliteTestCase.php'
);
require_once
(
'DataDict/PgsqlTestCase.php'
);
require_once
(
'DataDict/SqliteTestCase.php'
);
require_once
(
'DataDict/MysqlTestCase.php'
);
require_once
(
'DataDict/OracleTestCase.php'
);
$drivers
=
array
(
'Firebird'
,
'Informix'
,
'Mysql'
,
'Mssql'
,
'Oracle'
,
'Pgsql'
,
'Sqlite'
);
foreach
(
$drivers
as
$driver
)
{
require_once
(
'DataDict/'
.
$driver
.
'TestCase.php'
);
}
/**
class Doctrine_Tester {
protected $drivers = array('Firebird',
'Informix',
'Mysql',
'Mssql',
'Oracle',
'Pgsql',
'Sqlite'
);
public function loadModule($module) {
foreach($drivers as $driver) {
require_once($module . DIRECTORY_SEPARATOR . $driver . 'TestCase.php');
}
}
public function run($module) {
$this->loadModule($module);
foreach($drivers as $driver) {
}
}
}
*/
require_once
(
'ExportTestCase.php'
);
require_once
(
'ExportMysqlTestCase.php'
);
require_once
(
'ExportFirebirdTestCase.php'
);
...
...
@@ -94,11 +128,12 @@ $test->addTestCase(new Doctrine_Connection_Mysql_TestCase());
$test
->
addTestCase
(
new
Doctrine_Export_Mysql_TestCase
());
$test
->
addTestCase
(
new
Doctrine_DataDict_Pgsql_TestCase
());
$test
->
addTestCase
(
new
Doctrine_DataDict_Mysql_TestCase
());
foreach
(
$drivers
as
$driver
)
{
$class
=
'Doctrine_DataDict_'
.
$driver
.
'_TestCase'
;
$test
->
addTestCase
(
new
$class
());
}
$test
->
addTestCase
(
new
Doctrine_DataDict_Oracle_TestCase
());
/**
$test->addTestCase(new Doctrine_DataDict_Sqlite_TestCase());
$test->addTestCase(new Doctrine_Configurable_TestCase());
...
...
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