trait LazilyRefreshDatabase (View source)

Traits

Methods

array
migrateFreshUsing()

The parameters that should be used when running "migrate:fresh".

bool
shouldDropViews()

Determine if views should be dropped when refreshing the database.

bool
shouldDropTypes()

Determine if types should be dropped when refreshing the database.

bool
shouldSeed()

Determine if the seed task should be run when refreshing the database.

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.

bool
usingInMemoryDatabases()

Determine if any of the connections transacting is using in-memory databases.

bool
usingInMemoryDatabase(string|null $name = null)

Determine if a given database connection is an in-memory database.

void
restoreInMemoryDatabase()

Restore the in-memory database between tests.

void
refreshTestDatabase()

Refresh a conventional test database.

void
migrateDatabases()

Migrate the database.

void
beginDatabaseTransaction()

Begin a database transaction on the testing database.

array
connectionsToTransact()

The database connections that should have transactions.

void
beforeRefreshingDatabase()

Perform any work that should take place before the database has started refreshing.

void
afterRefreshingDatabase()

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".

Return Value

array

protected bool shouldDropViews()

Determine if views should be dropped when refreshing the database.

Return Value

bool

protected bool shouldDropTypes()

Determine if types should be dropped when refreshing the database.

Return Value

bool

protected bool shouldSeed()

Determine if the seed task should be run when refreshing the database.

Return Value

bool

protected mixed seeder()

Determine the specific seeder class that should be used when refreshing the database.

Return Value

mixed

void refreshDatabase()

Define hooks to migrate the database before and after each test.

Return Value

void

protected bool usingInMemoryDatabases()

Determine if any of the connections transacting is using in-memory databases.

Return Value

bool

protected bool usingInMemoryDatabase(string|null $name = null)

Determine if a given database connection is an in-memory database.

Parameters

string|null $name

Return Value

bool

protected void restoreInMemoryDatabase()

Restore the in-memory database between tests.

Return Value

void

protected void refreshTestDatabase()

Refresh a conventional test database.

Return Value

void

protected void migrateDatabases()

Migrate the database.

Return Value

void

void beginDatabaseTransaction()

Begin a database transaction on the testing database.

Return Value

void

protected array connectionsToTransact()

The database connections that should have transactions.

Return Value

array

protected void beforeRefreshingDatabase()

Perform any work that should take place before the database has started refreshing.

Return Value

void

protected void afterRefreshingDatabase()

Perform any work that should take place once the database has finished refreshing.

Return Value

void