diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index 16ad1b07f892c4d5c0ff9f6f68e1f37d00df6ce0..72ba4da6e5dd9366cbae3550f9f35f7c02e7ab16 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -2413,7 +2413,7 @@ class ManagerTest extends \Test\TestCase {
 		$tomorrow->setTime(0,0,0);
 		$tomorrow->add(new \DateInterval('P1D'));
 
-		$file = $this->getMock('OCP\Files\File', [], [], 'File');
+		$file = $this->createMock(File::class);
 		$file->method('getId')->willReturn(100);
 
 		$share = $this->manager->newShare();