summaryrefslogtreecommitdiff
path: root/modules/gallery/tests/Item_Model_Test.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-12-06 16:14:26 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-12-06 16:14:26 +0000
commitcf1965957c48b1c88a3913f8167688d03d191cec (patch)
tree9da9e719c68f4428771c9b70389b93f7a1bafd26 /modules/gallery/tests/Item_Model_Test.php
parent1659e487a26ef0460926376b7b8b40aaba0c0577 (diff)
parentc3ef8921260db8e39b6d2a7b4708e3d19f35f8b5 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/tests/Item_Model_Test.php')
-rw-r--r--modules/gallery/tests/Item_Model_Test.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php
index 90c54e3c..264a2128 100644
--- a/modules/gallery/tests/Item_Model_Test.php
+++ b/modules/gallery/tests/Item_Model_Test.php
@@ -406,6 +406,29 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
return; // pass
}
$this->assert_true(false, "Shouldn't get here");
+ }
+
+ public function urls_test() {
+ $photo = test::random_photo();
+ $this->assert_true(
+ preg_match("|http://./var/resizes/name_\d+\.jpg\?m=\d+|", $photo->resize_url()),
+ $photo->resize_url() . " is malformed");
+ $this->assert_true(
+ preg_match("|http://./var/thumbs/name_\d+\.jpg\?m=\d+|", $photo->thumb_url()),
+ $photo->thumb_url() . " is malformed");
+ $this->assert_true(
+ preg_match("|http://./var/albums/name_\d+\.jpg\?m=\d+|", $photo->file_url()),
+ $photo->file_url() . " is malformed");
+ // Albums have special thumbnails. Empty album has cachebuster of 0 since it has no thumbnail
+ $album = test::random_album();
+ $this->assert_true(
+ preg_match("|http://./var/thumbs/name_\d+/\.album\.jpg\?m=0|", $album->thumb_url()),
+ $album->thumb_url() . " is malformed");
+
+ $photo = test::random_photo($album);
+ $this->assert_true(
+ preg_match("|http://./var/thumbs/name_\d+/\.album\.jpg\?m=\d+|", $album->thumb_url()),
+ $album->thumb_url() . " is malformed");
}
}