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
c727c032
Commit
c727c032
authored
Dec 18, 2013
by
Guilherme Blanco
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #450 from deeky666/DBAL-122
[DBAL-122] Fix BLOB type mapping in SQL Server platform
parents
28264a15
ab996eae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
2 deletions
+83
-2
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+2
-2
SQLServerPlatformTest.php
...s/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
+81
-0
No files found.
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
c727c032
...
...
@@ -1258,9 +1258,9 @@ class SQLServerPlatform extends AbstractPlatform
'nchar'
=>
'string'
,
'nvarchar'
=>
'string'
,
'ntext'
=>
'text'
,
'binary'
=>
'
text
'
,
'binary'
=>
'
blob
'
,
'varbinary'
=>
'blob'
,
'image'
=>
'
text
'
,
'image'
=>
'
blob
'
,
'uniqueidentifier'
=>
'guid'
,
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
View file @
c727c032
...
...
@@ -589,4 +589,85 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
$this
->
_platform
->
getAlterTableSQL
(
$tableDiff
)
);
}
/**
* @group DBAL-122
*/
public
function
testInitializesDoctrineTypeMappings
()
{
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'bigint'
));
$this
->
assertSame
(
'bigint'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'bigint'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'numeric'
));
$this
->
assertSame
(
'decimal'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'numeric'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'bit'
));
$this
->
assertSame
(
'boolean'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'bit'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'smallint'
));
$this
->
assertSame
(
'smallint'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'smallint'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'decimal'
));
$this
->
assertSame
(
'decimal'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'decimal'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'smallmoney'
));
$this
->
assertSame
(
'integer'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'smallmoney'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'int'
));
$this
->
assertSame
(
'integer'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'int'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'tinyint'
));
$this
->
assertSame
(
'smallint'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'tinyint'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'money'
));
$this
->
assertSame
(
'integer'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'money'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'float'
));
$this
->
assertSame
(
'float'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'float'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'real'
));
$this
->
assertSame
(
'float'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'real'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'double'
));
$this
->
assertSame
(
'float'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'double'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'double precision'
));
$this
->
assertSame
(
'float'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'double precision'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'smalldatetime'
));
$this
->
assertSame
(
'datetime'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'smalldatetime'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'datetime'
));
$this
->
assertSame
(
'datetime'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'datetime'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'char'
));
$this
->
assertSame
(
'string'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'char'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'varchar'
));
$this
->
assertSame
(
'string'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'varchar'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'text'
));
$this
->
assertSame
(
'text'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'text'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'nchar'
));
$this
->
assertSame
(
'string'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'nchar'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'nvarchar'
));
$this
->
assertSame
(
'string'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'nvarchar'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'ntext'
));
$this
->
assertSame
(
'text'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'ntext'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'binary'
));
$this
->
assertSame
(
'blob'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'binary'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'varbinary'
));
$this
->
assertSame
(
'blob'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'varbinary'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'image'
));
$this
->
assertSame
(
'blob'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'image'
));
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'uniqueidentifier'
));
$this
->
assertSame
(
'guid'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'uniqueidentifier'
));
}
}
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