TestDatabases
trait TestDatabases
Properties
| static protected bool | $schemaIsUpToDate | Indicates if the test database schema is up to date. |
Methods
void
bootTestDatabase()
Boot a test database.
array
ensureTestDatabaseExists(string $database)
Ensure a test database exists and return its name.
void
ensureSchemaIsUpToDate()
Ensure the current database test schema is up to date.
void
usingDatabase(string $database, callable $callable)
Run the given callable using the given database.
void
whenNotUsingInMemoryDatabase(callable $callback)
Apply the given callback when tests are not using in-memory database.
void
switchToDatabase(string $database)
Switch to the given database.
string
testDatabase(string $database)
Get the test database name.
Details
at line 31
protected void
bootTestDatabase()
Boot a test database.
at line 90
protected array
ensureTestDatabaseExists(string $database)
Ensure a test database exists and return its name.
at line 113
protected void
ensureSchemaIsUpToDate()
Ensure the current database test schema is up to date.
at line 125
protected void
usingDatabase(string $database, callable $callable)
Run the given callable using the given database.
at line 140
protected void
whenNotUsingInMemoryDatabase(callable $callback)
Apply the given callback when tests are not using in-memory database.
at line 168
protected void
switchToDatabase(string $database)
Switch to the given database.
at line 192
protected string
testDatabase(string $database)
Get the test database name.