/** * Test that an array cache can be created. * * @dataProvider provideCacheDirectories() * * @param string $directory * @param string $class */ public function testArrayCacheProvider($directory, $class) { $config = $this->createMock(Config::class); $config->expects($this->once())->method('getCacheDirectory')->will($this->returnValue($directory)); $provider = new CacheProvider($config); $this->assertInstanceOf($class, $provider->getCache()); }
/** * Get cache. * * @return Cache */ public function getCache() { if (null === $this->cache) { $provider = new CacheProvider($this->config); $this->cache = $provider->getCache(); } return $this->cache; }