Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Flush about command during test runs #49557

Merged
merged 4 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
12 changes: 12 additions & 0 deletions src/Illuminate/Foundation/Console/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,16 @@ protected function toSearchKeyword(string $value)
{
return (string) Str::of($value)->lower()->snake();
}

/**
* Flush the registered about data.
*
* @return void
*/
public static function flushState()
{
static::$data = [];

static::$customDataResolvers = [];
}
}
2 changes: 2 additions & 0 deletions src/Illuminate/Foundation/Testing/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Console\Application as Artisan;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Bootstrap\HandleExceptions;
use Illuminate\Foundation\Console\AboutCommand;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Foundation\Http\Middleware\TrimStrings;
use Illuminate\Queue\Queue;
Expand Down Expand Up @@ -250,6 +251,7 @@ protected function tearDown(): void
HandleExceptions::forgetApp();
Queue::createPayloadUsing(null);
Sleep::fake(false);
AboutCommand::flushState();
TrimStrings::flushState();

if ($this->callbackException) {
Expand Down