trait TestDatabases (View source)
| static protected bool | $schemaIsUpToDate | Indicates if the test database schema is up to date. |
| void | bootTestDatabase()
Boot a test database. | |
| array | ensureTestDatabaseExists(string $database)
Ensure a test database exists and returns its name. | |
| void | ensureSchemaIsUpToDate()
Ensure the current database test schema is up to date. | |
| void | usingDatabase(string $database, callable $callable)
Runs 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($database)
Returns the test database name. |
Boot a test database.
Ensure a test database exists and returns its name.
Ensure the current database test schema is up to date.
Runs the given callable using the given database.
Apply the given callback when tests are not using in memory database.
Switch to the given database.
Returns the test database name.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Testing/Concerns/TestDatabases.html