Skip to content

Commit 42c1ce7

Browse files
committed
Work around the removal of Connection::connect()
1 parent 6189699 commit 42c1ce7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Consumption/Extension/DoctrinePingConnectionExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function onMessageReceived(MessageReceived $context): void
3636
);
3737

3838
$connection->close();
39-
$connection->connect();
39+
$connection->getServerVersion(); // calls connect() internally
4040

4141
$context->getLogger()->debug(
4242
'[DoctrinePingConnectionExtension] Connection is active now.'

Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testShouldNotReconnectIfConnectionIsOK()
4343
;
4444
$connection
4545
->expects($this->never())
46-
->method('connect')
46+
->method('getServerVersion')
4747
;
4848

4949
$context = $this->createContext();
@@ -83,7 +83,7 @@ public function testShouldDoesReconnectIfConnectionFailed()
8383
;
8484
$connection
8585
->expects($this->once())
86-
->method('connect')
86+
->method('getServerVersion')
8787
;
8888

8989
$context = $this->createContext();

0 commit comments

Comments
 (0)