This Laravel package provides a Redis mock for your tests
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.
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
Alternatively, you can switch to the mock in your
<env name="REDIS_CLIENT" value="mock"/>
Done! Your tests should work without a local redis server running.