shouldReceive('get') ->with('system', 'redis_host') ->andReturn('localhost'); $configMock ->shouldReceive('get') ->with('system', 'redis_port') ->andReturn(null); $configMock ->shouldReceive('get') ->with('system', 'redis_db', 0) ->andReturn(3); $configMock ->shouldReceive('get') ->with('system', 'redis_password') ->andReturn(null); $this->cache = new RedisCacheDriver('localhost', $configMock); return $this->cache; } public function tearDown() { $this->cache->clear(false); parent::tearDown(); } }