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
81b500da
Commit
81b500da
authored
Oct 16, 2015
by
Steve Müller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #912 from vincentchalamon/master
Fix bug about get default params on PoolingShardConnection
parents
532641f0
9b2f6484
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
PoolingShardConnection.php
lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php
+1
-1
PoolingShardConnectionTest.php
...ctrine/Tests/DBAL/Sharding/PoolingShardConnectionTest.php
+9
-6
No files found.
lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php
View file @
81b500da
...
...
@@ -141,7 +141,7 @@ class PoolingShardConnection extends Connection
*/
public
function
getParams
()
{
return
$this
->
activeShardId
?
$this
->
connections
[
$this
->
activeShardId
]
:
parent
::
getParams
()
;
return
$this
->
activeShardId
?
$this
->
connections
[
$this
->
activeShardId
]
:
$this
->
connections
[
0
]
;
}
/**
...
...
tests/Doctrine/Tests/DBAL/Sharding/PoolingShardConnectionTest.php
View file @
81b500da
...
...
@@ -209,9 +209,9 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
$conn
=
DriverManager
::
getConnection
(
array
(
'wrapperClass'
=>
'Doctrine\DBAL\Sharding\PoolingShardConnection'
,
'driver'
=>
'pdo_sqlite'
,
'global'
=>
array
(
'memory'
=>
true
),
'global'
=>
array
(
'memory'
=>
true
,
'host'
=>
'localhost'
),
'shards'
=>
array
(
array
(
'id'
=>
1
,
'memory'
=>
true
),
array
(
'id'
=>
1
,
'memory'
=>
true
,
'host'
=>
'foo'
),
),
'shardChoser'
=>
'Doctrine\DBAL\Sharding\ShardChoser\MultiTenantShardChoser'
,
));
...
...
@@ -219,24 +219,27 @@ class PoolingShardConnectionTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
array
(
'wrapperClass'
=>
'Doctrine\DBAL\Sharding\PoolingShardConnection'
,
'driver'
=>
'pdo_sqlite'
,
'global'
=>
array
(
'memory'
=>
true
),
'global'
=>
array
(
'memory'
=>
true
,
'host'
=>
'localhost'
),
'shards'
=>
array
(
array
(
'id'
=>
1
,
'memory'
=>
true
),
array
(
'id'
=>
1
,
'memory'
=>
true
,
'host'
=>
'foo'
),
),
'shardChoser'
=>
new
MultiTenantShardChoser
(),
'memory'
=>
true
,
'host'
=>
'localhost'
,
),
$conn
->
getParams
());
$conn
->
connect
(
1
);
$this
->
assertEquals
(
array
(
'wrapperClass'
=>
'Doctrine\DBAL\Sharding\PoolingShardConnection'
,
'driver'
=>
'pdo_sqlite'
,
'global'
=>
array
(
'memory'
=>
true
),
'global'
=>
array
(
'memory'
=>
true
,
'host'
=>
'localhost'
),
'shards'
=>
array
(
array
(
'id'
=>
1
,
'memory'
=>
true
),
array
(
'id'
=>
1
,
'memory'
=>
true
,
'host'
=>
'foo'
),
),
'shardChoser'
=>
new
MultiTenantShardChoser
(),
'id'
=>
1
,
'memory'
=>
true
,
'host'
=>
'foo'
,
),
$conn
->
getParams
());
}
...
...
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