Added browser refresh method

Closes #44
This commit is contained in:
Josh Sherman 2014-05-10 12:51:28 -04:00
parent 54875f149d
commit 0870c99ede
2 changed files with 20 additions and 0 deletions

View file

@ -137,6 +137,18 @@ class Browser extends Object
exit;
}
/**
* Refresh
*
* Forces a browser refresh of the currently requested page.
*
* @static
*/
public static function refresh()
{
Browser::redirect($_SERVER['REQUEST_URI']);
}
/**
* Remote IP
*

View file

@ -93,6 +93,14 @@ class BrowserTest extends PHPUnit_Framework_TestCase
Browser::status(500);
$this->assertTrue(in_array('Status: 500 Internal Server Error', xdebug_get_headers()));
}
public function testRefresh()
{
$_SERVER['REQUEST_URI'] = '/some/uri';
Browser::goHome();
Browser::refresh();
$this->assertTrue(in_array('Location: http://testsite.com/some/uri', xdebug_get_headers()));
}
}
?>