summaryrefslogtreecommitdiff
path: root/modules/gallery/tests
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r--modules/gallery/tests/Access_Helper_Test.php9
-rw-r--r--modules/gallery/tests/Cache_Test.php4
-rw-r--r--modules/gallery/tests/Item_Helper_Test.php3
-rw-r--r--modules/gallery/tests/Item_Rest_Helper_Test.php4
-rw-r--r--modules/gallery/tests/xss_data.txt41
5 files changed, 30 insertions, 31 deletions
diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php
index 5331117d..6eca396c 100644
--- a/modules/gallery/tests/Access_Helper_Test.php
+++ b/modules/gallery/tests/Access_Helper_Test.php
@@ -20,6 +20,10 @@
class Access_Helper_Test extends Gallery_Unit_Test_Case {
private $_group;
+ public function setup() {
+ identity::set_active_user(identity::guest());
+ }
+
public function teardown() {
try {
$group = identity::lookup_group_by_name("access_test");
@@ -41,10 +45,7 @@ class Access_Helper_Test extends Gallery_Unit_Test_Case {
// Reset some permissions that we mangle below
access::allow(identity::everybody(), "view", item::root());
- }
-
- public function setup() {
- identity::set_active_user(identity::guest());
+ identity::set_active_user(identity::admin_user());
}
public function groups_and_permissions_are_bound_to_columns_test() {
diff --git a/modules/gallery/tests/Cache_Test.php b/modules/gallery/tests/Cache_Test.php
index 1023568b..a942a292 100644
--- a/modules/gallery/tests/Cache_Test.php
+++ b/modules/gallery/tests/Cache_Test.php
@@ -118,7 +118,7 @@ class Cache_Test extends Gallery_Unit_Test_Case {
$value3 = array("field5" => "value5", "field6" => "value6");
$this->_driver->set(array($id3 => $value3), array("tag3", "tag4"), 84600);
- $this->_driver->delete($id1);
+ $this->_driver->delete(array($id1));
$this->assert_false($this->_driver->exists($id1), "$id1 should have been deleted");
$this->assert_true($this->_driver->exists($id2), "$id2 should not have been deleted");
@@ -138,7 +138,7 @@ class Cache_Test extends Gallery_Unit_Test_Case {
$value3 = array("field5" => "value5", "field6" => "value6");
$this->_driver->set(array($id3 => $value3), array("tag3", "tag4"), 84600);
- $data = $this->_driver->delete("tag3", true);
+ $data = $this->_driver->delete_tag(array("tag3"));
$this->assert_true($this->_driver->exists($id1), "$id1 should not have been deleted");
$this->assert_false($this->_driver->exists($id2), "$id2 should have been deleted");
diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php
index 50587702..90106562 100644
--- a/modules/gallery/tests/Item_Helper_Test.php
+++ b/modules/gallery/tests/Item_Helper_Test.php
@@ -18,8 +18,7 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Item_Helper_Test extends Gallery_Unit_Test_Case {
-
- public function setup() {
+ public function teardown() {
identity::set_active_user(identity::admin_user());
}
diff --git a/modules/gallery/tests/Item_Rest_Helper_Test.php b/modules/gallery/tests/Item_Rest_Helper_Test.php
index 6d1dd864..7b86c153 100644
--- a/modules/gallery/tests/Item_Rest_Helper_Test.php
+++ b/modules/gallery/tests/Item_Rest_Helper_Test.php
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case {
+ public function teardown() {
+ identity::set_active_user(identity::admin_user());
+ }
+
public function resolve_test() {
$album = test::random_album();
$resolved = rest::resolve(rest::url("item", $album));
diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt
index 44233459..a3ca31f4 100644
--- a/modules/gallery/tests/xss_data.txt
+++ b/modules/gallery/tests/xss_data.txt
@@ -218,8 +218,8 @@ modules/gallery/views/upgrader.html.php 77 DIRTY $modul
modules/gallery/views/upgrader.html.php 99 DIRTY_ATTR $done?"muted":""
modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $done?"muted":""
modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected)
-modules/gallery/views/user_profile.html.php 36 DIRTY_ATTR $user->avatar_url(40,$theme->url(,true))
-modules/gallery/views/user_profile.html.php 47 DIRTY $info->view
+modules/gallery/views/user_profile.html.php 34 DIRTY_ATTR $user->avatar_url(40,$theme->url(,true))
+modules/gallery/views/user_profile.html.php 43 DIRTY $info->view
modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url()
modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail"))
modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured)
@@ -250,11 +250,11 @@ modules/organize/views/organize_tree.html.php 2 DIRTY_ATTR acce
modules/organize/views/organize_tree.html.php 3 DIRTY_ATTR $album->id
modules/organize/views/organize_tree.html.php 6 DIRTY_ATTR $selected&&$album->id==$selected->id?"ui-state-focus":""
modules/organize/views/organize_tree.html.php 7 DIRTY_ATTR $album->id
-modules/organize/views/organize_tree.html.php 13 DIRTY View::factory("organize_tree.html",array("selected"=>$selected,"album"=>$child));
-modules/organize/views/organize_tree.html.php 15 DIRTY_ATTR access::can("edit",$child)?"":"g-view-only"
-modules/organize/views/organize_tree.html.php 16 DIRTY_ATTR $child->id
-modules/organize/views/organize_tree.html.php 18 DIRTY_ATTR $selected&&$child->id==$selected->id?"ui-state-focus":""
+modules/organize/views/organize_tree.html.php 15 DIRTY View::factory("organize_tree.html",array("selected"=>$selected,"album"=>$child));
+modules/organize/views/organize_tree.html.php 17 DIRTY_ATTR access::can("edit",$child)?"":"g-view-only"
modules/organize/views/organize_tree.html.php 18 DIRTY_ATTR $child->id
+modules/organize/views/organize_tree.html.php 20 DIRTY_ATTR $selected&&$child->id==$selected->id?"ui-state-focus":""
+modules/organize/views/organize_tree.html.php 20 DIRTY_ATTR $child->id
modules/recaptcha/views/admin_recaptcha.html.php 11 DIRTY $form
modules/recaptcha/views/admin_recaptcha.html.php 23 DIRTY_JS $public_key
modules/recaptcha/views/form_recaptcha.html.php 7 DIRTY_JS $public_key
@@ -274,21 +274,16 @@ modules/rss/views/feed.mrss.php 42 DIRTY_ATTR $chi
modules/rss/views/feed.mrss.php 48 DIRTY_ATTR $child->thumb_url(true)
modules/rss/views/feed.mrss.php 49 DIRTY_ATTR $child->thumb_height
modules/rss/views/feed.mrss.php 50 DIRTY_ATTR $child->thumb_width
-modules/rss/views/feed.mrss.php 54 DIRTY_ATTR $child->resize_url(true)
-modules/rss/views/feed.mrss.php 55 DIRTY_ATTR @filesize($child->resize_path())
-modules/rss/views/feed.mrss.php 56 DIRTY_ATTR $child->mime_type
-modules/rss/views/feed.mrss.php 57 DIRTY_ATTR $child->resize_height
-modules/rss/views/feed.mrss.php 58 DIRTY_ATTR $child->resize_width
-modules/rss/views/feed.mrss.php 61 DIRTY_ATTR $child->file_url(true)
-modules/rss/views/feed.mrss.php 62 DIRTY_ATTR @filesize($child->file_path())
-modules/rss/views/feed.mrss.php 63 DIRTY_ATTR $child->mime_type
-modules/rss/views/feed.mrss.php 64 DIRTY_ATTR $child->height
-modules/rss/views/feed.mrss.php 65 DIRTY_ATTR $child->width
-modules/rss/views/feed.mrss.php 70 DIRTY_ATTR $child->file_url(true)
-modules/rss/views/feed.mrss.php 71 DIRTY_ATTR @filesize($child->file_path())
-modules/rss/views/feed.mrss.php 72 DIRTY_ATTR $child->height
-modules/rss/views/feed.mrss.php 73 DIRTY_ATTR $child->width
-modules/rss/views/feed.mrss.php 74 DIRTY_ATTR $child->mime_type
+modules/rss/views/feed.mrss.php 57 DIRTY_ATTR $child->resize_url(true)
+modules/rss/views/feed.mrss.php 58 DIRTY_ATTR @filesize($child->resize_path())
+modules/rss/views/feed.mrss.php 59 DIRTY_ATTR $child->mime_type
+modules/rss/views/feed.mrss.php 60 DIRTY_ATTR $child->resize_height
+modules/rss/views/feed.mrss.php 61 DIRTY_ATTR $child->resize_width
+modules/rss/views/feed.mrss.php 65 DIRTY_ATTR $child->file_url(true)
+modules/rss/views/feed.mrss.php 66 DIRTY_ATTR @filesize($child->file_path())
+modules/rss/views/feed.mrss.php 67 DIRTY_ATTR $child->mime_type
+modules/rss/views/feed.mrss.php 68 DIRTY_ATTR $child->height
+modules/rss/views/feed.mrss.php 69 DIRTY_ATTR $child->width
modules/rss/views/rss_block.html.php 6 DIRTY_JS rss::url($url)
modules/search/views/search.html.php 27 DIRTY_ATTR $item_class
modules/search/views/search.html.php 28 DIRTY_JS $item->url()
@@ -320,8 +315,8 @@ modules/user/views/admin_users.html.php 87 DIRTY ($user
modules/user/views/admin_users.html.php 123 DIRTY_ATTR $group->id
modules/user/views/admin_users.html.php 123 DIRTY_ATTR ($group->special?"g-default-group":"")
modules/user/views/admin_users.html.php 125 DIRTY $v
-modules/user/views/admin_users_group.html.php 22 DIRTY_JS $user->id
-modules/user/views/admin_users_group.html.php 22 DIRTY_JS $group->id
+modules/user/views/admin_users_group.html.php 24 DIRTY_JS $user->id
+modules/user/views/admin_users_group.html.php 24 DIRTY_JS $group->id
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $width
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url