aragorn-yang / laravel-array-redis
This package is abandoned and no longer maintained.
The author suggests using the josiasmontag/laravel-redis-mock package instead.
A laravel wrapper for M6Web/RedisMock
v2.1.0
2020-01-09 17:38 UTC
Requires
- php: ^7.2
- laravel/framework: 6.*
- m6web/redis-mock: ^5.0
- predis/predis: ^1.1
Requires (Dev)
- orchestra/testbench: ~3.0
- phpunit/phpunit: 8.*
README
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"/>