RefreshDatabase
trait RefreshDatabase (View source)
Traits
Methods
The parameters that should be used when running "migrate:fresh".
Determine if views should be dropped when refreshing the database.
Determine if types should be dropped when refreshing the database.
Determine if the seed task should be run when refreshing the database.
Determine the specific seeder class that should be used when refreshing the database.
Define hooks to migrate the database before and after each test.
Determine if any of the connections transacting is using in-memory databases.
Determine if a given database connection is an in-memory database.
Restore the in-memory database between tests.
Refresh a conventional test database.
Migrate the database.
Begin a database transaction on the testing database.
The database connections that should have transactions.
Perform any work that should take place before the database has started refreshing.
Perform any work that should take place once the database has finished refreshing.
Details
protected array
migrateFreshUsing()
The parameters that should be used when running "migrate:fresh".
protected bool
shouldDropViews()
Determine if views should be dropped when refreshing the database.
protected bool
shouldDropTypes()
Determine if types should be dropped when refreshing the database.
protected bool
shouldSeed()
Determine if the seed task should be run when refreshing the database.
protected mixed
seeder()
Determine the specific seeder class that should be used when refreshing the database.
void
refreshDatabase()
Define hooks to migrate the database before and after each test.
protected bool
usingInMemoryDatabases()
Determine if any of the connections transacting is using in-memory databases.
protected bool
usingInMemoryDatabase(string|null $name = null)
Determine if a given database connection is an in-memory database.
protected void
restoreInMemoryDatabase()
Restore the in-memory database between tests.
protected void
refreshTestDatabase()
Refresh a conventional test database.
protected void
migrateDatabases()
Migrate the database.
void
beginDatabaseTransaction()
Begin a database transaction on the testing database.
protected array
connectionsToTransact()
The database connections that should have transactions.
protected void
beforeRefreshingDatabase()
Perform any work that should take place before the database has started refreshing.
protected void
afterRefreshingDatabase()
Perform any work that should take place once the database has finished refreshing.