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 8
8
use Enqueue \Consumption \Context \MessageReceived ;
9
9
use Enqueue \Consumption \MessageReceivedExtensionInterface ;
10
10
use ErrorException ;
11
+ use Throwable ;
11
12
12
13
class DoctrinePingConnectionExtension implements MessageReceivedExtensionInterface
13
14
{
@@ -58,7 +59,7 @@ private function ping(Connection $connection): bool
58
59
$ connection ->executeQuery ($ dummySelectSQL );
59
60
60
61
return true ;
61
- } catch (ErrorException | ConnectionLost $ exception ) {
62
+ } catch (Throwable $ exception ) {
62
63
return false ;
63
64
} finally {
64
65
restore_error_handler ();
Original file line number Diff line number Diff line change 3
3
namespace Enqueue \Bundle \Tests \Unit \Consumption \Extension ;
4
4
5
5
use Doctrine \DBAL \Connection ;
6
- use Doctrine \DBAL \Driver \DriverException ;
7
- use Doctrine \DBAL \Exception \ConnectionLost ;
8
6
use Doctrine \DBAL \Platforms \AbstractPlatform ;
9
7
use Doctrine \Persistence \ManagerRegistry ;
10
8
use Enqueue \Bundle \Consumption \Extension \DoctrinePingConnectionExtension ;
@@ -79,14 +77,10 @@ public function testShouldDoesReconnectIfConnectionFailed()
79
77
->willReturn (true )
80
78
;
81
79
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
-
86
80
$ connection
87
81
->expects ($ this ->once ())
88
82
->method ('getDatabasePlatform ' )
89
- ->willThrowException ($ exception )
83
+ ->willThrowException (new \ Exception () )
90
84
;
91
85
$ connection
92
86
->expects ($ this ->once ())
You can’t perform that action at this time.
0 commit comments