diff --git a/Tests/DependencyInjection/DoctrineCommandsTest.php b/Tests/DependencyInjection/DoctrineCommandsTest.php
index <HASH>..<HASH> 100644
--- a/Tests/DependencyInjection/DoctrineCommandsTest.php
+++ b/Tests/DependencyInjection/DoctrineCommandsTest.php
@@ -65,17 +65,13 @@ class DoctrineCommandsTest extends TestCase
      */
     private function getKernel(ContainerBuilder $container)
     {
-        $kernel = $this
-            ->getMockBuilder(KernelInterface::class)
-            ->getMock();
+        $kernel = $this->createMock(KernelInterface::class);
 
         $kernel
-            ->expects(self::any())
             ->method('getContainer')
             ->willReturn($container);
 
         $kernel
-            ->expects(self::once())
             ->method('getBundles')
             ->willReturn([]);
adjust the number of times a mock method should be invoked