Skip to content

Commit ac04a64

Browse files
author
Bastian Schwarz
committed
Replaced withConsecutive with ordered mockery call
1 parent 51a3fa6 commit ac04a64

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

test/taskHider/ByTaskListAndMatchersTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ public function testHide() : void {
6161
$this->sut->deployer = $this->createMock(Deployer::class);
6262
$this->sut->deployer->expects(self::once())->method('__get')->with('tasks')->willReturn([$task1, $task2, $task3, $task4, $task5]);
6363

64-
$this->sut->taskMatcher = $this->createMock(iTaskMatcher::class);
65-
$this->sut->taskMatcher
66-
->expects(self::exactly(5))
67-
->method('matches')
68-
->withConsecutive([$task1], [$task2], [$task3], [$task4], [$task5])
69-
->willReturnOnConsecutiveCalls(true, false, false, true, true);
64+
$this->sut->taskMatcher = \Mockery::mock(iTaskMatcher::class);
65+
$this->sut->taskMatcher->allows('matches')->once()->ordered()->with($task1)->andReturn(true);
66+
$this->sut->taskMatcher->allows('matches')->once()->ordered()->with($task2)->andReturn(false);
67+
$this->sut->taskMatcher->allows('matches')->once()->ordered()->with($task3)->andReturn(false);
68+
$this->sut->taskMatcher->allows('matches')->once()->ordered()->with($task4)->andReturn(true);
69+
$this->sut->taskMatcher->allows('matches')->once()->ordered()->with($task5)->andReturn(true);
7070

7171
$this->sut->hide();
7272
}

0 commit comments

Comments
 (0)