Skip to content

Commit 50a0dd0

Browse files
committed
Update README.md
1 parent aa385dd commit 50a0dd0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,18 @@ This will allow you to test with your models without needing to interact with Re
690690
```php
691691
use DirectoryTree\ActiveRedis\Model;
692692

693-
Model::setRepository('array');
693+
// Pest
694+
beforeEach(function () {
695+
Model::setRepository('array');
696+
});
697+
698+
// PHPUnit
699+
protected function setUp(): void
700+
{
701+
parent::setUp();
702+
703+
Model::setRepository('array');
704+
}
694705
```
695706

696707
Otherwise, you will need to run your tests with a Redis server running, and flush your Redis database after each test:
@@ -699,7 +710,9 @@ Otherwise, you will need to run your tests with a Redis server running, and flus
699710
use Illuminate\Support\Facades\Redis;
700711

701712
// Pest
702-
beforeEach(fn () => Redis::flushdb());
713+
beforeEach(function () {
714+
Redis::flushdb();
715+
});
703716

704717
// PHPUnit
705718
protected function setUp(): void

0 commit comments

Comments
 (0)