public function widgets($location = null, $zone = Zone::FRONTEND, $wrapper = 'widgetwrapper.twig')
{
if ($location === null && $this->app['twig.options']['strict_variables'] === true) {
throw new \InvalidArgumentException('widgets() requires a location, none given');
}
return $this->app['asset.queue.widget']->render($location, $zone, $wrapper);
}
public function testWidgetNoLocationStrict() { $app = $this->getApp(); $app['config']->set('general/strict_variables', true); $handler = new WidgetHandler($app); $widget = (new Widget())->setZone('frontend')->setLocation('gum-tree')->setContent('<blink>Drop Bear Warning!</blink>'); $this->setExpectedException('InvalidArgumentException', 'widgets() requires a location, none given'); $app['asset.queue.widget']->add($widget); $handler->widgets(); }