public function testBack() { $url = '/notes'; $_SERVER['HTTP_REFERER'] = $url; $this->assertEquals($url, Request::referer()); $redirect = Redirect::back(); $this->assertEquals($url, $redirect->path()); }
private function registerFunctions(Container $c) { $functions = array('style_tag' => 'twig_style_tag', 'script_tag' => 'twig_script_tag', 'dump' => 'twig_dump', 'gravatar' => 'gravatar_url', 'route_url' => function ($alias, $values = array()) { return Redirect::getRouteUrl($alias, $values); }); foreach ($functions as $key => $value) { $function = new Twig_SimpleFunction($key, $value, array('is_safe' => array('html'))); $c['twig.env']->addFunction($function); } }