/** * Constructor. * * @param AdapterInterface $adapter * @param CacheInterface $cache * @param mixed $config */ public function __construct(AdapterInterface $adapter, CacheInterface $cache = null, $config = null) { $this->adapter = $adapter; $this->cache = $cache ?: new Cache\Memory(); $this->cache->load(); $this->config = Util::ensureConfig($config); }
function let(AdapterInterface $adapter, CacheInterface $cache) { $this->adapter = $adapter; $this->cache = $cache; $cache->load()->shouldBeCalled(); $this->beConstructedWith($adapter, $cache); }