From 936ce0e881fd349377e5f0bf8ef9c3a069cf4739 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Fri, 17 Nov 2023 14:13:24 +0100 Subject: [PATCH] [CLEANUP] Use more stubs instead of mocks 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 f017d51a..7871f56b 100644 --- a/Tests/Unit/Controller/FrontEndEditorControllerTest.php +++ b/Tests/Unit/Controller/FrontEndEditorControllerTest.php @@ -114,7 +114,7 @@ public function indexActionForLoggedInUserAssignsTeasOwnedByTheLoggedInUserToVie $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 0cc2f472..a71c421a 100644 --- a/Tests/Unit/Controller/TeaControllerTest.php +++ b/Tests/Unit/Controller/TeaControllerTest.php @@ -68,7 +68,7 @@ public function isActionController(): void */ 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);