Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- The `--force-production` editor test no longer depends on test order. Switching the app to
`production` turns off Laravel's fakeable prompt fallback, so run alone (as the mutation job
can) the editor rendered real prompts with no TTY and `select()` threw
`NonInteractiveValidationException: Required.` The test now enables the fallback itself.

### Changed

- `illuminate/bus` is now declared in `require` at `^13.0`. `src/` imports it, and it was only arriving transitively.
Expand Down
10 changes: 10 additions & 0 deletions tests/Feature/TuiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Laravel\Prompts\Prompt;
use Simtabi\Laranail\EnvKit\Headless\Facades\EnvKit;
use Simtabi\Laranail\EnvKit\Headless\Tests\TestCase;
use Simtabi\Laranail\EnvKit\Headless\Contracts\EnvKitInterface;
Expand Down Expand Up @@ -102,6 +103,15 @@
$this->app['env'] = 'production';
$this->app->forgetInstance(EnvKitInterface::class);

// Leaving the testing environment turns off runningUnitTests(), which is what
// makes Laravel route prompts through its fakeable fallback. Without it the
// command renders real prompts, which read STDIN and, with no TTY, fall back
// to the empty default: select() then throws NonInteractiveValidationException.
// The fallback flag is sticky (fallbackWhen ORs), so this only passed when an
// earlier test had already set it -- and failed when run alone or reordered,
// as the mutation job does. Set it here so the test stands on its own.
Prompt::fallbackWhen(true);

$this->artisan('laranail::env-kit.edit', ['--force-production' => true])
->expectsQuestion('Choose a key or action', 'A')
->expectsQuestion('Edit [A]', 'Edit value')
Expand Down
Loading