Skip to content

Commit b49130b

Browse files
authored
I'm sure it'll work out at some point
1 parent d644d23 commit b49130b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/CliMenuTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -511,14 +511,10 @@ public function testAddCustomControlMappings() : void
511511
$first = true;
512512
$this->terminal->expects($this->any())
513513
->method('read')
514-
->willReturn(
514+
->will(
515515
$this->returnCallback(
516-
function() use ($first) {
517-
if ($first) {
518-
$first = false;
519-
return 'c';
520-
}
521-
return 'x';
516+
function() use (&$first) {
517+
return $first ? 'c' : 'x';
522518
}
523519
)
524520
);
@@ -539,6 +535,7 @@ function() use ($first) {
539535
$menu->open();
540536
static::assertStringEqualsFile($this->getTestFile(), $this->output->fetch());
541537

538+
$first = false;
542539
$menu->open();
543540
static::assertStringEqualsFile($this->getTestFile(), $this->output->fetch());
544541
}

0 commit comments

Comments
 (0)