Fix test mocking

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-12-30 12:54:19 +01:00
parent 7291c46d0d
commit 74814ad614
14 changed files with 32 additions and 55 deletions

View File

@@ -123,20 +123,9 @@ class BoardServiceTest extends TestCase {
$b3 = new Board();
$b3->setId(3);
$this->boardMapper->expects($this->once())
->method('findAllByUser')
->method('findAllForUser')
->with('admin')
->willReturn([$b1, $b2]);
$this->stackMapper->expects($this->any())
->method('findAll')
->willReturn([]);
$this->boardMapper->expects($this->once())
->method('findAllByGroups')
->with('admin', ['a', 'b', 'c'])
->willReturn([$b2, $b3]);
$this->boardMapper->expects($this->once())
->method('findAllByCircles')
->with('admin')
->willReturn([]);
->willReturn([$b1, $b2, $b3]);
$user = $this->createMock(IUser::class);
$this->groupManager->method('getUserGroupIds')
->willReturn(['a', 'b', 'c']);