parent
54875f149d
commit
0870c99ede
2 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue