File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
Tests/Unit/Consumption/Extension Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 88use Enqueue \Consumption \Context \MessageReceived ;
99use Enqueue \Consumption \MessageReceivedExtensionInterface ;
1010use ErrorException ;
11+ use Throwable ;
1112
1213class DoctrinePingConnectionExtension implements MessageReceivedExtensionInterface
1314{
@@ -58,7 +59,7 @@ private function ping(Connection $connection): bool
5859 $ connection ->executeQuery ($ dummySelectSQL );
5960
6061 return true ;
61- } catch (ErrorException | ConnectionLost $ exception ) {
62+ } catch (Throwable $ exception ) {
6263 return false ;
6364 } finally {
6465 restore_error_handler ();
Original file line number Diff line number Diff line change 33namespace Enqueue \Bundle \Tests \Unit \Consumption \Extension ;
44
55use Doctrine \DBAL \Connection ;
6- use Doctrine \DBAL \Driver \DriverException ;
7- use Doctrine \DBAL \Exception \ConnectionLost ;
86use Doctrine \DBAL \Platforms \AbstractPlatform ;
97use Doctrine \Persistence \ManagerRegistry ;
108use Enqueue \Bundle \Consumption \Extension \DoctrinePingConnectionExtension ;
@@ -79,14 +77,10 @@ public function testShouldDoesReconnectIfConnectionFailed()
7977 ->willReturn (true )
8078 ;
8179
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-
8680 $ connection
8781 ->expects ($ this ->once ())
8882 ->method ('getDatabasePlatform ' )
89- ->willThrowException ($ exception )
83+ ->willThrowException (new \ Exception () )
9084 ;
9185 $ connection
9286 ->expects ($ this ->once ())
You can’t perform that action at this time.
0 commit comments