diff --git a/src/Illuminate/Foundation/Testing/RefreshDatabase.php b/src/Illuminate/Foundation/Testing/RefreshDatabase.php index 46250cff154c..5358242f7f89 100644 --- a/src/Illuminate/Foundation/Testing/RefreshDatabase.php +++ b/src/Illuminate/Foundation/Testing/RefreshDatabase.php @@ -6,13 +6,6 @@ trait RefreshDatabase { - /** - * Indicates if the test database has been migrated. - * - * @var bool - */ - protected static $migrated = false; - /** * Define hooks to migrate the database before and after each test. * @@ -56,12 +49,12 @@ protected function refreshInMemoryDatabase() */ protected function refreshTestDatabase() { - if (! static::$migrated) { + if (! RefreshDatabaseState::$migrated) { $this->artisan('migrate:fresh'); $this->app[Kernel::class]->setArtisan(null); - static::$migrated = true; + RefreshDatabaseState::$migrated = true; } $this->beginDatabaseTransaction(); diff --git a/src/Illuminate/Foundation/Testing/RefreshDatabaseState.php b/src/Illuminate/Foundation/Testing/RefreshDatabaseState.php new file mode 100644 index 000000000000..1f33087396f6 --- /dev/null +++ b/src/Illuminate/Foundation/Testing/RefreshDatabaseState.php @@ -0,0 +1,13 @@ +