Save and Restore the $_POST variable in tests that manipulate it so

other tests don't fail unexpectedly
This commit is contained in:
Tim Almdal
2009-05-11 14:31:07 +00:00
parent 8b33371e99
commit 784b3aa34a
4 changed files with 23 additions and 2 deletions

View File

@@ -19,11 +19,16 @@
*/
class REST_Controller_Test extends Unit_Test_Case {
public function setup() {
$this->_post = $_POST;
$this->mock_controller = new Mock_RESTful_Controller("mock");
$this->mock_not_loaded_controller = new Mock_RESTful_Controller("mock_not_loaded");
$_POST = array();
}
public function teardown() {
$_POST = $this->_post;
}
public function dispatch_index_test() {
$_SERVER["REQUEST_METHOD"] = "GET";
$_POST["_method"] = "";