Skip to content

Commit

Permalink
add the beforeRefreshingDatabase function (#42073)
Browse files Browse the repository at this point in the history
  • Loading branch information
roksprogar authored Apr 21, 2022
1 parent 3f2845c commit 8c737f0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Illuminate/Foundation/Testing/RefreshDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ trait RefreshDatabase
*/
public function refreshDatabase()
{
$this->beforeRefreshingDatabase();

$this->usingInMemoryDatabase()
? $this->refreshInMemoryDatabase()
: $this->refreshTestDatabase();
Expand Down Expand Up @@ -126,6 +128,16 @@ protected function connectionsToTransact()
? $this->connectionsToTransact : [null];
}

/**
* Perform any work that should take place before the database has started refreshing.
*
* @return void
*/
protected function beforeRefreshingDatabase()
{
// ...
}

/**
* Perform any work that should take place once the database has finished refreshing.
*
Expand Down

0 comments on commit 8c737f0

Please sign in to comment.