public function testDeleteCache() { $options = new CacheOptions(); $options->setEnabled(true); $cacheManger = new CacheManager($options); $adapter = new \Zend\Cache\Storage\Adapter\Memory(); $options->setAdapter($adapter); $adapter->addItem('stuff13', new \ArrayObject()); $this->assertTrue($adapter->hasItem('stuff13')); $cacheManger->delete('stuff13'); $this->assertFalse($adapter->hasItem('stuff13')); }
/** * Gets cache manager * * @param ServiceLocatorInterface $serviceLocator * @return CacheManager */ public function createService(ServiceLocatorInterface $serviceLocator) { $cacheManager = new CacheManager($serviceLocator->get('HtSettingsModule\\Options\\ModuleOptions')->getCacheOptions()); $cacheManager->setServiceLocator($serviceLocator); return $cacheManager; }