| Package Data | |
|---|---|
| Maintainer Username: | josiasmontag |
| Maintainer Contact: | josias@montag.info (Josias Montag) |
| Package Create Date: | 2017-11-03 |
| Package Last Update: | 2025-05-05 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-09 03:01:37 |
| Package Statistics | |
|---|---|
| Total Downloads: | 1,627,734 |
| Monthly Downloads: | 29,069 |
| Daily Downloads: | 158 |
| Total Stars: | 46 |
| Total Watchers: | 3 |
| Total Forks: | 10 |
| Total Open Issues: | 2 |
This Laravel package provides a Redis mock for your tests. It depends on Redis PHP Mock.
To get started, use Composer to add the package to your project's dependencies:
composer require josiasmontag/laravel-redis-mock
This package adds a new mock Redis client.
In config/database.php, make the Redis client configurable via environment variable:
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
...
],
Now, you can switch to the mock client in your .env.testing:
REDIS_CLIENT=mock
Alternatively, you can switch to the mock in your phpunit.xml:
<env name="REDIS_CLIENT" value="mock"/>
Done! Your tests should work without a local redis server running.