@@ -51,8 +51,8 @@ public function log($level, $message, $context = []): void
     public function testMiddlewareWrapsInTransactionAndFlushes()
     {
         $this->connection->expects($this->exactly(1))
-            ->method('isTransactionActive')
-            ->will($this->onConsecutiveCalls(true, true, false))
+            ->method('getTransactionNestingLevel')
+            ->willReturn(1)
         ;
 
         $this->middleware->handle(new Envelope(new \stdClass()), $this->getStackMock());