Skip to content

Commit 2510198

Browse files
committed
Fix for doctrine/dbal v2 and v3
1 parent 874d652 commit 2510198

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,15 @@ public function testShouldDoesReconnectIfConnectionFailed()
7878
->method('isConnected')
7979
->willReturn(true)
8080
;
81+
82+
$exception = class_exists(DriverException::class)
83+
? new ConnectionLost('message', $this->createMock(DriverException::class))
84+
: new ConnectionLost($this->createMock(Doctrine\DBAL\Driver\Exception::class), null);
85+
8186
$connection
8287
->expects($this->once())
8388
->method('getDatabasePlatform')
84-
->willThrowException(new ConnectionLost('message', $this->createMock(DriverException::class)))
89+
->willThrowException($exception)
8590
;
8691
$connection
8792
->expects($this->once())

0 commit comments

Comments
 (0)