save('test', 'mycontent'); // make sure something was changed, otherwise it won't save anything /** @var Cache\Backend $backend */ $backend = StaticContainer::get('Piwik\Cache\Backend'); $this->assertFalse($backend->doContains($storageId)); $result = ''; $module = 'CoreHome'; $action = 'index'; $params = array(); Piwik::postEvent('Request.dispatch.end', array(&$result, $module, $action, $params)); // should trigger save $this->assertTrue($backend->doContains($storageId)); } }