Skip to content

Commit e9a468b

Browse files
authored
phpunit isn't that logical...
1 parent 4cff9ee commit e9a468b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/CliMenuTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,16 @@ public function testAddCustomControlMappingsThrowsExceptionWhenAttemptingToOverw
508508

509509
public function testAddCustomControlMappings() : void
510510
{
511-
$this->terminal->expects($this->at(0))
512-
->method('read')
513-
->willReturn('c');
514-
$this->terminal->expects($this->at(1))
511+
$first = true;
512+
$this->terminal->expects($this->any())
515513
->method('read')
516-
->willReturn('x');
514+
->willReturn(function() use ($first) {
515+
if ($first) {
516+
$first = false;
517+
return 'c';
518+
}
519+
return 'x';
520+
});
517521

518522
$style = $this->getStyle($this->terminal);
519523

0 commit comments

Comments
 (0)