summaryrefslogtreecommitdiff
path: root/modules/gallery/tests/Albums_Controller_Test.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/tests/Albums_Controller_Test.php')
-rw-r--r--modules/gallery/tests/Albums_Controller_Test.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/gallery/tests/Albums_Controller_Test.php b/modules/gallery/tests/Albums_Controller_Test.php
index 5f23f821..4d8935cd 100644
--- a/modules/gallery/tests/Albums_Controller_Test.php
+++ b/modules/gallery/tests/Albums_Controller_Test.php
@@ -20,7 +20,6 @@
class Albums_Controller_Test extends Unit_Test_Case {
public function setup() {
$this->_save = array($_POST, $_SERVER);
- $_SERVER["HTTP_REFERER"] = "HTTP_REFERER";
}
public function teardown() {
@@ -36,8 +35,10 @@ class Albums_Controller_Test extends Unit_Test_Case {
$this->_album = album::create($root, "test", "test", "test");
$orig_name = $this->_album->name;
- $_POST["dirname"] = "test";
- $_POST["name"] = "new name";
+ // Randomize to avoid conflicts.
+ $new_dirname = "new_name_" . rand();
+
+ $_POST["dirname"] = $new_dirname;
$_POST["title"] = "new title";
$_POST["description"] = "new description";
$_POST["column"] = "weight";
@@ -53,13 +54,11 @@ class Albums_Controller_Test extends Unit_Test_Case {
ob_end_clean();
$this->assert_equal(
- json_encode(array("result" => "success", "location" => "HTTP_REFERER")),
+ json_encode(array("result" => "success")),
$results);
+ $this->assert_equal($new_dirname, $this->_album->name);
$this->assert_equal("new title", $this->_album->title);
$this->assert_equal("new description", $this->_album->description);
-
- // We don't change the name, yet.
- $this->assert_equal($orig_name, $this->_album->name);
}
public function change_album_no_csrf_fails_test() {