trait
Illuminate
/
Testing
/
Concerns
/
TestDatabases
You are viewing an older version of the documentation. For the latest, please visit master documentation.
TestDatabases
Properties
protected
static
$schemaIsUpToDate bool
Indicates if the test database schema is up to date.
Default: false
Methods
protected
bootTestDatabase ( ) : void
Boot a test database.
protected
ensureTestDatabaseExists ( $database ) : array
Ensure a test database exists and returns its name.
Parameters
- $database string
protected
ensureSchemaIsUpToDate ( ) : void
Ensure the current database test schema is up to date.
protected
usingDatabase ( $database , $callable ) : void
Runs the given callable using the given database.
Parameters
- $database string
- $callable callable
protected
whenNotUsingInMemoryDatabase ( $callback ) : void
Apply the given callback when tests are not using in memory database.
Parameters
- $callback callable
protected
switchToDatabase ( $database ) : void
Switch to the given database.
Parameters
- $database string
protected
testDatabase ( $database ) : string
Returns the test database name.