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
cc8e0222
Commit
cc8e0222
authored
Nov 11, 2014
by
Marco Pivetta
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #726 from alekitto/ms_reconnect_notice
MasterSlaveConnection::close() should reset connections array
parents
a2e87c57
fcbb2a7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
MasterSlaveConnection.php
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
+3
-0
MasterSlaveConnectionTest.php
...trine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php
+13
-0
No files found.
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
View file @
cc8e0222
...
...
@@ -290,6 +290,9 @@ class MasterSlaveConnection extends Connection
unset
(
$this
->
connections
[
'slave'
]);
parent
::
close
();
$this
->
_conn
=
null
;
$this
->
connections
=
array
(
'master'
=>
null
,
'slave'
=>
null
);
}
/**
...
...
tests/Doctrine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php
View file @
cc8e0222
...
...
@@ -126,4 +126,17 @@ class MasterSlaveConnectionTest extends DbalFunctionalTestCase
$conn
->
connect
(
'slave'
);
$this
->
assertFalse
(
$conn
->
isConnectedToMaster
());
}
public
function
testMasterSlaveConnectionCloseAndReconnect
()
{
$conn
=
$this
->
createMasterSlaveConnection
();
$conn
->
connect
(
'master'
);
$this
->
assertTrue
(
$conn
->
isConnectedToMaster
());
$conn
->
close
();
$this
->
assertFalse
(
$conn
->
isConnectedToMaster
());
$conn
->
connect
(
'master'
);
$this
->
assertTrue
(
$conn
->
isConnectedToMaster
());
}
}
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