Skip to content

Commit

Permalink
test: add test for CLI::prompt()
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Aug 3, 2022
1 parent e311426 commit d787fe6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/system/CLI/CLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ public function testWaitZero()
PhpStreamWrapper::restore();
}

public function testPrompt()
{
PhpStreamWrapper::register();

$expected = 'red';
PhpStreamWrapper::setContent($expected);

$output = CLI::prompt('What is your favorite color?');

$this->assertSame($expected, $output);

PhpStreamWrapper::restore();
}

public function testIsWindows()
{
$this->assertSame(('\\' === DIRECTORY_SEPARATOR), CLI::isWindows());
Expand Down

0 comments on commit d787fe6

Please sign in to comment.