Skip to content

Commit

Permalink
Flush about command during test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Jan 2, 2024
1 parent 0d5072b commit de6c438
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Illuminate/Foundation/Console/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,16 @@ protected function toSearchKeyword(string $value)
{
return (string) Str::of($value)->lower()->snake();
}

/**
* Flush the registered about data.
*
* @return void
*/
public static function flush()
{
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\Queue\Queue;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Facade;
Expand Down Expand Up @@ -247,6 +248,7 @@ protected function tearDown(): void
Queue::createPayloadUsing(null);
HandleExceptions::forgetApp();
Sleep::fake(false);
AboutCommand::flush();

if ($this->callbackException) {
throw $this->callbackException;
Expand Down

0 comments on commit de6c438

Please sign in to comment.