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
73106085
Commit
73106085
authored
Jul 10, 2013
by
ramonornela
Committed by
Benjamin Eberlei
Dec 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] - Portability SQLSERVER
- name platform 'sqlsrv' nonexistent and E_NOTICE index array.
parent
0087f3fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
Connection.php
lib/Doctrine/DBAL/Portability/Connection.php
+2
-2
PortabilityTest.php
tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php
+21
-0
No files found.
lib/Doctrine/DBAL/Portability/Connection.php
View file @
73106085
...
...
@@ -75,10 +75,10 @@ class Connection extends \Doctrine\DBAL\Connection
$params
[
'portability'
]
=
self
::
PORTABILITY_DRIZZLE
;
}
else
if
(
$this
->
_platform
->
getName
()
===
'sqlanywhere'
)
{
$params
[
'portability'
]
=
self
::
PORTABILITY_SQLANYWHERE
;
}
else
if
(
$this
->
_platform
->
getName
()
===
'sqlsrv'
)
{
$params
[
'portability'
]
=
$params
[
'portabililty'
]
&
self
::
PORTABILITY_SQLSRV
;
}
elseif
(
$this
->
_platform
->
getName
()
===
'db2'
)
{
$params
[
'portability'
]
=
self
::
PORTABILITY_DB2
;
}
else
if
(
$this
->
_platform
->
getName
()
===
'mssql'
)
{
$params
[
'portability'
]
=
$params
[
'portability'
]
&
self
::
PORTABILITY_SQLSRV
;
}
else
{
$params
[
'portability'
]
=
$params
[
'portability'
]
&
self
::
PORTABILITY_OTHERVENDORS
;
}
...
...
tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php
View file @
73106085
...
...
@@ -6,6 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\DriverManager
;
use
PDO
;
use
Doctrine\DBAL\Portability\Connection
as
ConnectionPortability
;
require_once
__DIR__
.
'/../../TestInit.php'
;
...
...
@@ -124,4 +125,24 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
assertNull
(
$row
[
'test_null'
]);
$this
->
assertArrayNotHasKey
(
0
,
$row
,
"PDO::FETCH_ASSOC should not return numerical keys."
);
}
public
function
testPortabilitySqlServer
()
{
$portability
=
ConnectionPortability
::
PORTABILITY_SQLSRV
;
$params
=
array
(
'portability'
=>
$portability
);
$driverMock
=
$this
->
getMock
(
'Doctrine\\DBAL\\Driver\\PDOSqlsrv\\Driver'
,
array
(
'connect'
));
$driverMock
->
expects
(
$this
->
once
())
->
method
(
'connect'
)
->
will
(
$this
->
returnValue
(
null
));
$connection
=
new
ConnectionPortability
(
$params
,
$driverMock
);
$connection
->
connect
(
$params
);
$this
->
assertEquals
(
$portability
,
$connection
->
getPortability
());
}
}
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