From de6c43830057022b02203c687900c84378425dad Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 3 Jan 2024 09:35:25 +1100 Subject: [PATCH] Flush about command during test runs --- src/Illuminate/Foundation/Console/AboutCommand.php | 12 ++++++++++++ src/Illuminate/Foundation/Testing/TestCase.php | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/Illuminate/Foundation/Console/AboutCommand.php b/src/Illuminate/Foundation/Console/AboutCommand.php index 23d2b23b631a..3dbcaf4af6aa 100644 --- a/src/Illuminate/Foundation/Console/AboutCommand.php +++ b/src/Illuminate/Foundation/Console/AboutCommand.php @@ -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 = []; + } } diff --git a/src/Illuminate/Foundation/Testing/TestCase.php b/src/Illuminate/Foundation/Testing/TestCase.php index a7315a2c5124..130cd285c41f 100644 --- a/src/Illuminate/Foundation/Testing/TestCase.php +++ b/src/Illuminate/Foundation/Testing/TestCase.php @@ -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; @@ -247,6 +248,7 @@ protected function tearDown(): void Queue::createPayloadUsing(null); HandleExceptions::forgetApp(); Sleep::fake(false); + AboutCommand::flush(); if ($this->callbackException) { throw $this->callbackException;