Skip to content

Commit 67b4273

Browse files
committed
Test invoking autocomplete handler on tab key
1 parent ecbb126 commit 67b4273

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/ReadlineTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,16 @@ public function testAutocompleteGetterReturnsSameFromSetter()
504504
$this->assertSame($autocomplete, $this->readline->getAutocomplete());
505505
}
506506

507+
public function testKeysTabInvokesAutocompleteHandler()
508+
{
509+
$autocomplete = $this->getMock('Clue\React\Stdio\Readline\Autocomplete');
510+
$autocomplete->expects($this->once())->method('go')->with($this->equalTo($this->readline));
511+
512+
$this->readline->setAutocomplete($autocomplete);
513+
514+
$this->readline->onKeyTab();
515+
}
516+
507517
public function testEmitEmptyInputOnEnter()
508518
{
509519
$this->readline->on('data', $this->expectCallableOnceWith(''));

0 commit comments

Comments
 (0)