// Test the cacheFlush method invalidates the cache.
$cache_plugin = $view->display_handler->getPlugin('cache'); $this->assertTrue($cache_plugin->cacheGet('results'), 'Results cache found.'); $this->assertNotEmpty($this->getRenderCache($view), 'Output cache found.');
$cache_plugin->cacheFlush();
$cache_plugin = $view->display_handler->getPlugin('cache'); $this->assertFalse($cache_plugin->cacheGet('results'), 'Results cache empty after the cacheFlush() method is called.'); $this->assertFalse($this->getRenderCache($view), 'Output cache empty after the cacheFlush() method is called.'); }
/**
* {@inheritdoc}
*/ publicfunctionsubmitOptionsForm(&$form, FormStateInterface $form_state){ // Not sure I like this being here, but it seems (?) like a logical place.
$cache_plugin = $this->getPlugin('cache'); if($cache_plugin){ $cache_plugin->cacheFlush(); }