shouldReceive('get') ->with('system', 'memcache_host') ->andReturn('localhost'); $configMock ->shouldReceive('get') ->with('system', 'memcache_port') ->andReturn(11211); return new CacheLock(new MemcacheCache('localhost', $configMock)); } }