Skip to content

Commit

Permalink
[CLEANUP] Use more stubs instead of mocks (#995)
Browse files Browse the repository at this point in the history
This makes the purpose of the test doubles more clear to the reader.

Fixes #986
  • Loading branch information
oliverklee authored Nov 18, 2023
1 parent 3cdf8df commit 4509052
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Tests/Unit/Controller/FrontEndEditorControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Controller/TeaControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4509052

Please sign in to comment.