public function run()
{
$args = func_get_args();
$this->instantiateWidget($args);
$content = $this->getContentFromCache($args);
if ($timeout = (double) $this->getReloadTimeout()) {
$content .= $this->javascriptFactory->getReloader($timeout);
$content = $this->wrapContentInContainer($content);
}
return $this->convertToViewExpression($content);
}
public function testItCanCacheWidgets() { $output = $this->factory->run('testCachedWidget', ['foo' => 'bar']); $key = 'arrilot.widgets.' . serialize(['testCachedWidget', ['foo' => 'bar']]); $widget = new TestCachedWidget(); $this->assertEquals('Cached output. Key: ' . $key . ', minutes: ' . $widget->cacheTime, $output); }