PasswordTest.php 508 B

1234567891011121314151617181920
  1. <?php
  2. namespace League\CLImate\Tests;
  3. class PasswordTest extends TestBase
  4. {
  5. /** @test */
  6. public function it_will_hide_the_user_response()
  7. {
  8. $this->shouldReceiveSameLine();
  9. $this->shouldWrite("\e[mGimmie the secret: \e[0m");
  10. $this->reader->shouldReceive('hidden')->andReturn('mypasswordyo');
  11. $input = $this->cli->password('Gimmie the secret:', $this->reader);
  12. $response = $input->prompt();
  13. $this->assertSame($response, 'mypasswordyo');
  14. }
  15. }