mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-22 23:05:18 -04:00
Save and Restore the $_POST variable in tests that manipulate it so
other tests don't fail unexpectedly
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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"] = "";
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user