Skip to content

Commit

Permalink
Merge branch 'feature/expects-confirmation-in-console' of https://git…
Browse files Browse the repository at this point in the history
…hub.com/ShawnCZek/framework into ShawnCZek-feature/expects-confirmation-in-console
  • Loading branch information
taylorotwell committed Mar 14, 2020
2 parents 42b3118 + 40fa30e commit 1c5d64d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Illuminate/Testing/PendingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(PHPUnitTestCase $test, Container $app, $command, $pa
* Specify a question that should be asked when the command runs.
*
* @param string $question
* @param string $answer
* @param string|bool $answer
* @return $this
*/
public function expectsQuestion($question, $answer)
Expand All @@ -86,6 +86,18 @@ public function expectsQuestion($question, $answer)
return $this;
}

/**
* Specify a confirmation question that should be asked when the command runs.
*
* @param string $question
* @param string $answer
* @return $this
*/
public function expectsConfirmation($question, $answer = 'no')
{
return $this->expectsQuestion($question, strtolower($answer) === 'yes');
}

/**
* Specify output that should be printed when the command runs.
*
Expand Down

0 comments on commit 1c5d64d

Please sign in to comment.