|
2 | 2 |
|
3 | 3 | it('returns invalid', function () {
|
4 | 4 | $this->artisan('codebarista:failed-jobs')
|
5 |
| - ->expectsQuestion('What is the action: retry or delete?', 'invalid') |
| 5 | + ->expectsChoice('What action should be taken?', 'invalid', [ |
| 6 | + 'delete', |
| 7 | + 'retry', |
| 8 | + ]) |
6 | 9 | ->assertExitCode(2);
|
7 | 10 | });
|
8 | 11 |
|
9 | 12 | it('aborts retry failed jobs', function () {
|
10 | 13 | $this->artisan('codebarista:failed-jobs')
|
11 |
| - ->expectsQuestion('What is the action: retry or delete?', 'retry') |
| 14 | + ->expectsChoice('What action should be taken?', 'retry', [ |
| 15 | + 'delete', |
| 16 | + 'retry', |
| 17 | + ]) |
12 | 18 | ->expectsConfirmation('Really retry all failed jobs?')
|
13 | 19 | ->expectsOutputToContain('Process terminated by user')
|
14 | 20 | ->assertExitCode(0);
|
15 | 21 | });
|
16 | 22 |
|
17 | 23 | it('aborts delete failed jobs', function () {
|
18 | 24 | $this->artisan('codebarista:failed-jobs')
|
19 |
| - ->expectsQuestion('What is the action: retry or delete?', 'delete') |
| 25 | + ->expectsChoice('What action should be taken?', 'delete', [ |
| 26 | + 'delete', |
| 27 | + 'retry', |
| 28 | + ]) |
20 | 29 | ->expectsConfirmation('Really delete all failed jobs?')
|
21 | 30 | ->expectsOutputToContain('Process terminated by user')
|
22 | 31 | ->assertExitCode(0);
|
23 | 32 | });
|
24 | 33 |
|
25 | 34 | it('retries failed jobs', function () {
|
26 | 35 | $this->artisan('codebarista:failed-jobs')
|
27 |
| - ->expectsQuestion('What is the action: retry or delete?', 'retry') |
| 36 | + ->expectsChoice('What action should be taken?', 'retry', [ |
| 37 | + 'delete', |
| 38 | + 'retry', |
| 39 | + ]) |
28 | 40 | ->expectsConfirmation('Really retry all failed jobs?', 'yes')
|
29 | 41 | ->expectsOutputToContain('jobs retried')
|
30 | 42 | ->assertExitCode(0);
|
31 | 43 | });
|
32 | 44 |
|
33 | 45 | it('deletes failed jobs', function () {
|
34 | 46 | $this->artisan('codebarista:failed-jobs')
|
35 |
| - ->expectsQuestion('What is the action: retry or delete?', 'delete') |
| 47 | + ->expectsChoice('What action should be taken?', 'delete', [ |
| 48 | + 'delete', |
| 49 | + 'retry', |
| 50 | + ]) |
36 | 51 | ->expectsConfirmation('Really delete all failed jobs?', 'yes')
|
37 | 52 | ->expectsOutputToContain('jobs deleted')
|
38 | 53 | ->assertExitCode(0);
|
|
0 commit comments