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
41e5b466
Commit
41e5b466
authored
Nov 24, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated datadict driver tests
parent
de94e464
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
23 deletions
+41
-23
PgsqlTestCase.php
tests/DataDict/PgsqlTestCase.php
+5
-0
SqliteTestCase.php
tests/DataDict/SqliteTestCase.php
+36
-23
No files found.
tests/DataDict/PgsqlTestCase.php
View file @
41e5b466
<?php
<?php
class
Doctrine_DataDict_Pgsql_TestCase
extends
Doctrine_Driver_UnitTestCase
{
class
Doctrine_DataDict_Pgsql_TestCase
extends
Doctrine_Driver_UnitTestCase
{
public
function
__construct
()
{
parent
::
__construct
(
'pgsql'
);
}
public
function
getDeclaration
(
$type
)
{
public
function
getDeclaration
(
$type
)
{
return
$this
->
dataDict
->
getDoctrineDeclaration
(
array
(
'type'
=>
$type
,
'name'
=>
'colname'
,
'length'
=>
2
,
'fixed'
=>
true
));
return
$this
->
dataDict
->
getDoctrineDeclaration
(
array
(
'type'
=>
$type
,
'name'
=>
'colname'
,
'length'
=>
2
,
'fixed'
=>
true
));
}
}
public
function
testGetDoctrineDefinition
()
{
public
function
testGetDoctrineDefinition
()
{
$this
->
assertEqual
(
$this
->
getDeclaration
(
'smallint'
),
array
(
array
(
'integer'
,
'boolean'
),
2
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'smallint'
),
array
(
array
(
'integer'
,
'boolean'
),
2
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'int2'
),
array
(
array
(
'integer'
,
'boolean'
),
2
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'int2'
),
array
(
array
(
'integer'
,
'boolean'
),
2
,
false
,
null
));
...
...
tests/DataDict/SqliteTestCase.php
View file @
41e5b466
<?php
<?php
class
Doctrine_DataDict_Sqlite_TestCase
extends
Doctrine_Driver_UnitTestCase
{
class
Doctrine_DataDict_Sqlite_TestCase
extends
Doctrine_Driver_UnitTestCase
{
public
function
getDeclaration
(
$type
)
{
public
function
__construct
(
)
{
return
$this
->
dataDict
->
getDoctrineDeclaration
(
array
(
'type'
=>
$type
,
'name'
=>
'colname'
,
'length'
=>
2
,
'fixed'
=>
true
)
);
parent
::
__construct
(
'sqlite'
);
}
}
public
function
testGetDoctrineDefinition
()
{
$this
->
assertEqual
(
$this
->
getDeclaration
(
'boolean'
),
array
(
array
(
'boolean'
),
1
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'tinyint'
),
array
(
array
(
'integer'
,
'boolean'
),
1
,
false
,
null
));
public
function
testBooleanMapsToBooleanType
()
{
$this
->
assertEqual
(
$this
->
getDeclaration
(
'smallint'
),
array
(
array
(
'integer'
),
2
,
false
,
null
));
$this
->
assertDeclarationType
(
'boolean'
,
'boolean'
);
$this
->
assertEqual
(
$this
->
getDeclaration
(
'mediumint'
),
array
(
array
(
'integer'
),
2
,
false
,
null
));
}
$this
->
assertEqual
(
$this
->
getDeclaration
(
'int'
),
array
(
array
(
'integer'
),
4
,
false
,
null
));
public
function
testIntegersMapToIntegerType
()
{
$this
->
assertEqual
(
$this
->
getDeclaration
(
'integer'
),
array
(
array
(
'integer'
),
4
,
false
,
null
));
$this
->
assertDeclarationType
(
'tinyint'
,
array
(
'integer'
,
'boolean'
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'serial'
),
array
(
array
(
'integer'
),
4
,
false
,
null
));
$this
->
assertDeclarationType
(
'smallint'
,
'integer'
);
$this
->
assertEqual
(
$this
->
getDeclaration
(
'bigint'
),
array
(
array
(
'integer'
),
8
,
false
,
null
));
$this
->
assertDeclarationType
(
'mediumint'
,
'integer'
);
$this
->
assertEqual
(
$this
->
getDeclaration
(
'bigserial'
),
array
(
array
(
'integer'
),
8
,
false
,
null
));
$this
->
assertDeclarationType
(
'int'
,
'integer'
);
$this
->
assertDeclarationType
(
'integer'
,
'integer'
);
$this
->
assertDeclarationType
(
'serial'
,
'integer'
);
$this
->
assertDeclarationType
(
'bigint'
,
'integer'
);
$this
->
assertDeclarationType
(
'bigserial'
,
'integer'
);
}
public
function
testBlobsMapToBlobType
(
){
$this
->
assertDeclarationType
(
'tinyblob'
,
'blob'
);
$this
->
assertDeclarationType
(
'mediumblob'
,
'blob'
);
$this
->
assertDeclarationType
(
'longblob'
,
'blob'
);
$this
->
assertDeclarationType
(
'blob'
,
'blob'
);
}
public
function
testDecimalMapsToDecimal
()
{
$this
->
assertDeclarationType
(
'decimal'
,
'decimal'
);
$this
->
assertDeclarationType
(
'numeric'
,
'decimal'
);
}
public
function
testFloatRealAndDoubleMapToFloat
()
{
$this
->
assertDeclarationType
(
'float'
,
'float'
);
$this
->
assertDeclarationType
(
'double'
,
'float'
);
$this
->
assertDeclarationType
(
'real'
,
'float'
);
}
public
function
testYearMapsToIntegerAndDate
()
{
$this
->
assertDeclarationType
(
'year'
,
array
(
'integer'
,
'date'
));
}
public
function
testSomething
(
){
/**
/**
$this->assertEqual($this->getDeclaration('clob'), array(array('integer', 'boolean'), 1, false, null));
$this->assertEqual($this->getDeclaration('clob'), array(array('integer', 'boolean'), 1, false, null));
$this->assertEqual($this->getDeclaration('tinytext'), array(array('integer'), 2, false, null));
$this->assertEqual($this->getDeclaration('tinytext'), array(array('integer'), 2, false, null));
$this->assertEqual($this->getDeclaration('mediumtext'), array(array('integer'), 2, false, null));
$this->assertEqual($this->getDeclaration('mediumtext'), array(array('integer'), 2, false, null));
...
@@ -28,17 +51,7 @@ class Doctrine_DataDict_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase {
...
@@ -28,17 +51,7 @@ class Doctrine_DataDict_Sqlite_TestCase extends Doctrine_Driver_UnitTestCase {
$this->assertEqual($this->getDeclaration('datetime'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('datetime'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('timestamp'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('timestamp'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('time'), array(array('integer'), 8, false, null));
$this->assertEqual($this->getDeclaration('time'), array(array('integer'), 8, false, null));
*/
$this
->
assertEqual
(
$this
->
getDeclaration
(
'float'
),
array
(
array
(
'float'
),
8
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'double'
),
array
(
array
(
'float'
),
8
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'real'
),
array
(
array
(
'float'
),
8
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'decimal'
),
array
(
array
(
'decimal'
),
8
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'numeric'
),
array
(
array
(
'decimal'
),
8
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'tinyblob'
),
array
(
array
(
'blob'
),
8
,
false
,
null
));
*/
$this
->
assertEqual
(
$this
->
getDeclaration
(
'mediumblob'
),
array
(
array
(
'blob'
),
8
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'longblob'
),
array
(
array
(
'blob'
),
8
,
false
,
null
));
$this
->
assertEqual
(
$this
->
getDeclaration
(
'blob'
),
array
(
array
(
'blob'
),
8
,
false
,
null
));
}
}
}
}
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