Download the PHP package californiamountainsnake/laravel-database-test-case without Composer
On this page you can find all versions of the php package californiamountainsnake/laravel-database-test-case. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download californiamountainsnake/laravel-database-test-case
More information about californiamountainsnake/laravel-database-test-case
Files in californiamountainsnake/laravel-database-test-case
Package laravel-database-test-case
Short Description This is the class intended for the testing the anything that need the database connection with Laravel.
License MIT
Informations about the package laravel-database-test-case
laravel-database-test-case
Do you want to test your models, repositories, controllers on the real database? This library can help you! It creates temporary user and databases, perform your migrations and seeds databases. And then always deletes them when tests have been finished, even if there were exceptions and errors. And, of course, your usual database will not be affected.
Compatibility
This library supports PHP ^7.1
and a lot of versions of Laravel: ^5.5
, ^6.0
, ^7.0
, ^8.0
.
The main condition: you must have a mysql user that have privileges to create and delete other users and databases (for creation and deletion temp user and databases).
Install:
Require this package with Composer
Install this package through Composer.
Edit your project's composer.json
file to require californiamountainsnake/laravel-database-test-case
:
and run composer update
or
run this command in your command line:
Usage:
Extend the AbstractDatabaseTestCase
class and implement the abstract methods:
And that's it! Now you can extend your database tests from your DatabaseTestCase
and execute queries to the database using your usual models:
All versions of laravel-database-test-case with dependencies
ext-pdo Version *
ext-json Version *
laravel/framework Version ^5.5||^6.0||^7.0||^8.0