13
13
14
14
use Doctrine \DBAL \Abstraction \Result ;
15
15
use Doctrine \DBAL \DBALException ;
16
+ use Doctrine \DBAL \Exception ;
16
17
use Doctrine \DBAL \Platforms \AbstractPlatform ;
17
18
use Doctrine \DBAL \Query \QueryBuilder ;
18
19
use Doctrine \DBAL \Schema \AbstractSchemaManager ;
@@ -87,7 +88,12 @@ public function testItThrowsATransportExceptionIfItCannotAcknowledgeMessage()
87
88
{
88
89
$ this ->expectException ('Symfony\Component\Messenger\Exception\TransportException ' );
89
90
$ driverConnection = $ this ->getDBALConnectionMock ();
90
- $ driverConnection ->method ('delete ' )->willThrowException (new DBALException ());
91
+
92
+ if (class_exists (Exception::class)) {
93
+ $ driverConnection ->method ('delete ' )->willThrowException (new Exception ());
94
+ } else {
95
+ $ driverConnection ->method ('delete ' )->willThrowException (new DBALException ());
96
+ }
91
97
92
98
$ connection = new Connection ([], $ driverConnection );
93
99
$ connection ->ack ('dummy_id ' );
@@ -97,7 +103,12 @@ public function testItThrowsATransportExceptionIfItCannotRejectMessage()
97
103
{
98
104
$ this ->expectException ('Symfony\Component\Messenger\Exception\TransportException ' );
99
105
$ driverConnection = $ this ->getDBALConnectionMock ();
100
- $ driverConnection ->method ('delete ' )->willThrowException (new DBALException ());
106
+
107
+ if (class_exists (Exception::class)) {
108
+ $ driverConnection ->method ('delete ' )->willThrowException (new Exception ());
109
+ } else {
110
+ $ driverConnection ->method ('delete ' )->willThrowException (new DBALException ());
111
+ }
101
112
102
113
$ connection = new Connection ([], $ driverConnection );
103
114
$ connection ->reject ('dummy_id ' );
0 commit comments