From 450905287cbb5f69f420a948ce295e717151e2b9 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 18 Nov 2023 06:48:56 +0100 Subject: [PATCH] [CLEANUP] Use more stubs instead of mocks (#995) This makes the purpose of the test doubles more clear to the reader. Fixes #986 --- Tests/Unit/Controller/FrontEndEditorControllerTest.php | 2 +- Tests/Unit/Controller/TeaControllerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Unit/Controller/FrontEndEditorControllerTest.php b/Tests/Unit/Controller/FrontEndEditorControllerTest.php index f017d51..7871f56 100644 --- a/Tests/Unit/Controller/FrontEndEditorControllerTest.php +++ b/Tests/Unit/Controller/FrontEndEditorControllerTest.php @@ -114,7 +114,7 @@ final class FrontEndEditorControllerTest extends UnitTestCase $userUid = 5; $this->setUidOfLoggedInUser($userUid); - $teas = $this->createMock(QueryResultInterface::class); + $teas = $this->createStub(QueryResultInterface::class); $this->teaRepositoryMock->method('findByOwnerUid')->with($userUid)->willReturn($teas); $this->viewMock->expects(self::once())->method('assign')->with('teas', $teas); diff --git a/Tests/Unit/Controller/TeaControllerTest.php b/Tests/Unit/Controller/TeaControllerTest.php index 0cc2f47..a71c421 100644 --- a/Tests/Unit/Controller/TeaControllerTest.php +++ b/Tests/Unit/Controller/TeaControllerTest.php @@ -68,7 +68,7 @@ final class TeaControllerTest extends UnitTestCase */ public function indexActionAssignsAllTeaAsTeasToView(): void { - $teas = $this->createMock(QueryResultInterface::class); + $teas = $this->createStub(QueryResultInterface::class); $this->teaRepositoryMock->method('findAll')->willReturn($teas); $this->viewMock->expects(self::once())->method('assign')->with('teas', $teas);