summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/tests/Albums_Controller_Test.php6
-rw-r--r--core/tests/Photos_Controller_Test.php6
-rw-r--r--core/tests/REST_Controller_Test.php5
-rw-r--r--core/tests/REST_Helper_Test.php8
4 files changed, 23 insertions, 2 deletions
diff --git a/core/tests/Albums_Controller_Test.php b/core/tests/Albums_Controller_Test.php
index 747b7427..1aef97a7 100644
--- a/core/tests/Albums_Controller_Test.php
+++ b/core/tests/Albums_Controller_Test.php
@@ -18,8 +18,12 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Albums_Controller_Test extends Unit_Test_Case {
+ public function setup() {
+ $this->_post = $_POST;
+ }
+
public function teardown() {
- unset($_POST);
+ $_POST = $this->_post;
}
public function change_album_test() {
diff --git a/core/tests/Photos_Controller_Test.php b/core/tests/Photos_Controller_Test.php
index 2b28f774..b40a9677 100644
--- a/core/tests/Photos_Controller_Test.php
+++ b/core/tests/Photos_Controller_Test.php
@@ -18,8 +18,12 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Photos_Controller_Test extends Unit_Test_Case {
+ public function setup() {
+ $this->_post = $_POST;
+ }
+
public function teardown() {
- unset($_POST);
+ $_POST = $this->_post;
}
public function change_photo_test() {
diff --git a/core/tests/REST_Controller_Test.php b/core/tests/REST_Controller_Test.php
index 760af864..af46a72f 100644
--- a/core/tests/REST_Controller_Test.php
+++ b/core/tests/REST_Controller_Test.php
@@ -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"] = "";
diff --git a/core/tests/REST_Helper_Test.php b/core/tests/REST_Helper_Test.php
index 27828d89..e5ef645b 100644
--- a/core/tests/REST_Helper_Test.php
+++ b/core/tests/REST_Helper_Test.php
@@ -18,6 +18,14 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class REST_Helper_Test extends Unit_Test_Case {
+ public function setup() {
+ $this->_post = $_POST;
+ }
+
+ public function teardown() {
+ $_POST = $this->_post;
+ }
+
public function request_method_test() {
foreach (array("GET", "POST") as $method) {
foreach (array("", "PUT", "DELETE") as $tunnel) {