From 6a57cde7c10011a8f62d9bc9d095e0215dc82856 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Wed, 27 Jan 2021 14:04:45 +0100 Subject: [PATCH] Use createMock() instead of a getter --- Tests/Mapping/Loader/FilesLoaderTest.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Tests/Mapping/Loader/FilesLoaderTest.php b/Tests/Mapping/Loader/FilesLoaderTest.php index bc6aab8a3..6bba637a9 100644 --- a/Tests/Mapping/Loader/FilesLoaderTest.php +++ b/Tests/Mapping/Loader/FilesLoaderTest.php @@ -20,13 +20,13 @@ class FilesLoaderTest extends TestCase { public function testCallsGetFileLoaderInstanceForeachPath() { - $loader = $this->getFilesLoader($this->getFileLoader()); + $loader = $this->getFilesLoader($this->createMock(LoaderInterface::class)); $this->assertEquals(4, $loader->getTimesCalled()); } public function testCallsActualFileLoaderForMetadata() { - $fileLoader = $this->getFileLoader(); + $fileLoader = $this->createMock(LoaderInterface::class); $fileLoader->expects($this->exactly(4)) ->method('loadClassMetadata'); $loader = $this->getFilesLoader($fileLoader); @@ -42,9 +42,4 @@ public function getFilesLoader(LoaderInterface $loader) __DIR__.'/constraint-mapping.txt', ], $loader]); } - - public function getFileLoader() - { - return $this->createMock(LoaderInterface::class); - } }