Skip to content

Commit ef147ea

Browse files
authored
Merge pull request mongodb#1941 from divine/pr_1476
[Updated PR#1476] Add explanation for database migration resets
2 parents c55d42d + 0bbb404 commit ef147ea

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: README.md

+20
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This package adds functionalities to the Eloquent model and Query builder for Mo
1616
- [Lumen](#lumen)
1717
- [Non-Laravel projects](#non-laravel-projects)
1818
- [Testing](#testing)
19+
- [Database Testing](#database-testing)
1920
- [Configuration](#configuration)
2021
- [Eloquent](#eloquent)
2122
- [Extending the base model](#extending-the-base-model)
@@ -113,6 +114,25 @@ To run the test for this package, run:
113114
docker-compose up
114115
```
115116

117+
Database Testing
118+
-------
119+
120+
To reset the database after each test, add:
121+
122+
```php
123+
use Illuminate\Foundation\Testing\DatabaseMigrations;
124+
```
125+
126+
Also inside each test classes, add:
127+
128+
```php
129+
use DatabaseMigrations;
130+
```
131+
132+
Keep in mind that these traits are not yet supported:
133+
- `use Database Transactions;`
134+
- `use RefreshDatabase;`
135+
116136
Configuration
117137
-------------
118138
You can use MongoDB either as the main database, either as a side database. To do so, add a new `mongodb` connection to `config/database.php`:

0 commit comments

Comments
 (0)