aragorn-yang/laravel-array-redis

A laravel wrapper for M6Web/RedisMock


Keywords
redis, mock, array, fake, laravel
License
MIT

Documentation

Laravel Array Redis

A laravel wrapper for M6Web/RedisMock. You can mock your Redis in your tests without a running redis server.

Build Status Total Downloads Latest Stable Version License

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.

  1. You can set it in your .env.testing:
REDIS_CLIENT=array
  1. Alternatively, you can do it in your phpunit.xml:
<env name="REDIS_CLIENT" value="array"/>