File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,17 @@ public function setAutocomplete(Autocomplete $autocomplete)
411411 return $ this ;
412412 }
413413
414+ /**
415+ * Gets the current autocomplete handler in use
416+ *
417+ * @return Autocomplete
418+ * @see self::setAutocomplete()
419+ */
420+ public function getAutocomplete ()
421+ {
422+ return $ this ->autocomplete ;
423+ }
424+
414425 /**
415426 * redraw the current input prompt
416427 *
Original file line number Diff line number Diff line change @@ -495,6 +495,15 @@ public function testCursorCellObeysCustomEchoAsterisk(Readline $readline)
495495 $ this ->assertEquals (3 , $ readline ->getCursorCell ());
496496 }
497497
498+ public function testAutocompleteGetterReturnsSameFromSetter ()
499+ {
500+ $ autocomplete = $ this ->getMock ('Clue\React\Stdio\Readline\Autocomplete ' );
501+
502+ $ this ->assertSame ($ this ->readline , $ this ->readline ->setAutocomplete ($ autocomplete ));
503+
504+ $ this ->assertSame ($ autocomplete , $ this ->readline ->getAutocomplete ());
505+ }
506+
498507 public function testEmitEmptyInputOnEnter ()
499508 {
500509 $ this ->readline ->on ('data ' , $ this ->expectCallableOnceWith ('' ));
You can’t perform that action at this time.
0 commit comments