Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
cerbero90 committed Jan 16, 2025
1 parent 84a8852 commit 4c95366
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/Feature/EnumMakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@
]);

it('generates enums with prompts', function() {
// Currently textarea() of Laravel Prompts seems to have some testing issues.
// Apparently the method expectsQuestion() does not test textarea rightly.
// In alternative, we fallback the prompt with the expected user input.
TextareaPrompt::fallbackUsing(fn() => 'CaseOne' . PHP_EOL . 'CaseTwo');

$command = $this->artisan('enum:make')
->expectsQuestion('The namespace of the enum', 'App\Enums\Generated1')
->expectsQuestion('How cases should be backed', 'bitwise');
// ->expectsQuestion('The cases (one per line)', 'CaseOne' . PHP_EOL . 'CaseTwo');
->expectsQuestion('How cases should be backed', 'bitwise')
->expectsQuestion('The cases (one per line)', 'CaseOne' . PHP_EOL . 'CaseTwo');

expect($command)->toGenerate('App\Enums\Generated1');
});

0 comments on commit 4c95366

Please sign in to comment.