@@ -312,8 +312,9 @@ public function testTransactionMethodRetriesOnDeadlock()
312
312
$ this ->expectException (QueryException::class);
313
313
$ this ->expectExceptionMessage ('Deadlock found when trying to get lock (SQL: ) ' );
314
314
315
- $ pdo = $ this ->getMockBuilder (DatabaseConnectionTestMockPDO::class)->onlyMethods (['beginTransaction ' , 'commit ' , 'rollBack ' ])->getMock ();
315
+ $ pdo = $ this ->getMockBuilder (DatabaseConnectionTestMockPDO::class)->onlyMethods (['inTransaction ' , ' beginTransaction ' , 'commit ' , 'rollBack ' ])->getMock ();
316
316
$ mock = $ this ->getMockConnection ([], $ pdo );
317
+ $ pdo ->method ('inTransaction ' )->willReturn (true );
317
318
$ pdo ->expects ($ this ->exactly (3 ))->method ('beginTransaction ' );
318
319
$ pdo ->expects ($ this ->exactly (3 ))->method ('rollBack ' );
319
320
$ pdo ->expects ($ this ->never ())->method ('commit ' );
@@ -324,8 +325,10 @@ public function testTransactionMethodRetriesOnDeadlock()
324
325
325
326
public function testTransactionMethodRollsbackAndThrows ()
326
327
{
327
- $ pdo = $ this ->getMockBuilder (DatabaseConnectionTestMockPDO::class)->onlyMethods (['beginTransaction ' , 'commit ' , 'rollBack ' ])->getMock ();
328
+ $ pdo = $ this ->getMockBuilder (DatabaseConnectionTestMockPDO::class)->onlyMethods (['inTransaction ' , ' beginTransaction ' , 'commit ' , 'rollBack ' ])->getMock ();
328
329
$ mock = $ this ->getMockConnection ([], $ pdo );
330
+ // $pdo->expects($this->once())->method('inTransaction');
331
+ $ pdo ->method ('inTransaction ' )->willReturn (true );
329
332
$ pdo ->expects ($ this ->once ())->method ('beginTransaction ' );
330
333
$ pdo ->expects ($ this ->once ())->method ('rollBack ' );
331
334
$ pdo ->expects ($ this ->never ())->method ('commit ' );
0 commit comments