Skip to content

Commit 757848e

Browse files
[10.x] Flush about command during test runs (#49557)
* Flush about command during test runs * Update name * Update TestCase.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent f493ec5 commit 757848e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Illuminate/Foundation/Console/AboutCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,4 +302,16 @@ protected function toSearchKeyword(string $value)
302302
{
303303
return (string) Str::of($value)->lower()->snake();
304304
}
305+
306+
/**
307+
* Flush the registered about data.
308+
*
309+
* @return void
310+
*/
311+
public static function flushState()
312+
{
313+
static::$data = [];
314+
315+
static::$customDataResolvers = [];
316+
}
305317
}

src/Illuminate/Foundation/Testing/TestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Console\Application as Artisan;
77
use Illuminate\Database\Eloquent\Model;
88
use Illuminate\Foundation\Bootstrap\HandleExceptions;
9+
use Illuminate\Foundation\Console\AboutCommand;
910
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
1011
use Illuminate\Foundation\Http\Middleware\TrimStrings;
1112
use Illuminate\Queue\Queue;
@@ -242,6 +243,7 @@ protected function tearDown(): void
242243
$this->originalExceptionHandler = null;
243244
$this->originalDeprecationHandler = null;
244245

246+
AboutCommand::flushState();
245247
Artisan::forgetBootstrappers();
246248
Component::flushCache();
247249
Component::forgetComponentsResolver();

0 commit comments

Comments
 (0)