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
04c60c84
Commit
04c60c84
authored
Feb 16, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
ccda68dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
26 deletions
+105
-26
MysqlTestCase.php
tests/DataDict/MysqlTestCase.php
+105
-26
No files found.
tests/DataDict/MysqlTestCase.php
View file @
04c60c84
...
...
@@ -52,123 +52,202 @@ class Doctrine_DataDict_Mysql_TestCase extends Doctrine_UnitTestCase {
{
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'tinyint'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'integer'
,
'boolean'
),
1
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'integer'
,
'boolean'
),
'length'
=>
1
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'smallint unsigned'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'integer'
),
2
,
true
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'integer'
),
'length'
=>
2
,
'unsigned'
=>
true
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'mediumint unsigned'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'integer'
),
3
,
true
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'integer'
),
'length'
=>
3
,
'unsigned'
=>
true
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'int unsigned'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'integer'
),
4
,
true
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'integer'
),
'length'
=>
4
,
'unsigned'
=>
true
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'integer unsigned'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'integer'
),
4
,
true
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'integer'
),
'length'
=>
4
,
'unsigned'
=>
true
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'bigint unsigned'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'integer'
),
8
,
true
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'integer'
),
'length'
=>
8
,
'unsigned'
=>
true
,
'fixed'
=>
null
));
}
public
function
testGetPortableDeclarationSupportsNativeStringTypes
()
{
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'text'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'string'
,
'clob'
),
null
,
null
,
false
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'string'
,
'clob'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
false
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'longtext'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'string'
,
'clob'
),
null
,
null
,
false
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'string'
,
'clob'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
false
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'mediumtext'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'string'
,
'clob'
),
null
,
null
,
false
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'string'
,
'clob'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
false
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'tinytext'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'string'
,
'clob'
),
null
,
null
,
false
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'string'
,
'clob'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
false
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'char(1)'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'string'
,
'boolean'
),
1
,
null
,
true
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'string'
,
'boolean'
),
'length'
=>
1
,
'unsigned'
=>
null
,
'fixed'
=>
true
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'varchar(1)'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'string'
,
'boolean'
),
1
,
null
,
false
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'string'
,
'boolean'
),
'length'
=>
1
,
'unsigned'
=>
null
,
'fixed'
=>
false
));
}
public
function
testGetPortableDeclarationSupportsNativeFloatTypes
()
{
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'float'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'float'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'float'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'real unsigned'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'float'
),
null
,
true
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'float'
),
'length'
=>
null
,
'unsigned'
=>
true
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'double'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'float'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'float'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
}
public
function
testGetPortableDeclarationSupportsNativeDateType
()
{
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'date'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'date'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'date'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
}
public
function
testGetPortableDeclarationSupportsNativeDecimalTypes
()
{
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'decimal'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'decimal'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'decimal'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'unknown'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'decimal'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'decimal'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'numeric'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'decimal'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'decimal'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
}
public
function
testGetPortableDeclarationSupportsNativeTimestampTypes
()
{
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'timestamp'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'timestamp'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'timestamp'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'datetime'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'timestamp'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'timestamp'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
}
public
function
testGetPortableDeclarationSupportsNativeYearType
()
{
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'year'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'integer'
,
'date'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'integer'
,
'date'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
}
public
function
testGetPortableDeclarationSupportsNativeBlobTypes
()
{
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'blob'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'blob'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'blob'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'mediumblob'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'blob'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'blob'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'tinyblob'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'blob'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'blob'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
$type
=
$this
->
dataDict
->
getPortableDeclaration
(
array
(
'type'
=>
'longblob'
));
$this
->
assertEqual
(
$type
,
array
(
array
(
'blob'
),
null
,
null
,
null
));
$this
->
assertEqual
(
$type
,
array
(
'type'
=>
array
(
'blob'
),
'length'
=>
null
,
'unsigned'
=>
null
,
'fixed'
=>
null
));
}
public
function
testGetNativeDefinitionSupportsIntegerType
()
...
...
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