Laravel Array Redis
A laravel wrapper for M6Web/RedisMock. You can mock your Redis in your tests without a running redis server.
Installation & Usage
Use Composer to add this package to your project's dev-dependencies:
composer require --dev aragorn-yang/laravel-array-redis
In config/database.php
, make the Redis client configurable via environment variable:
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
],
Now, you can switch to the array
client via environment setting.
- You can set it in your
.env.testing
:
REDIS_CLIENT=array
- Alternatively, you can do it in your
phpunit.xml
:
<env name="REDIS_CLIENT" value="array"/>