summaryrefslogtreecommitdiff
path: root/modules/gallery/tests/Graphics_Helper_Test.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-01-31 15:48:18 -0800
committerBharat Mediratta <bharat@menalto.com>2013-01-31 15:48:18 -0800
commitcb08f6cc13bfd07aed2e6588cad6a6cc655b73f6 (patch)
tree6c99c587e0fb6ee029773ea5690f9e92d28d4e9a /modules/gallery/tests/Graphics_Helper_Test.php
parent795f2569941f582127885f0bdcabe089d644a5d6 (diff)
parentf83ed5f8716663a45c9d8e8118bbcf0e2849c3fb (diff)
Merge pull request #115 from shadlaws/fix_1982
#1982 - Add placeholder for albums with no album cover.
Diffstat (limited to 'modules/gallery/tests/Graphics_Helper_Test.php')
-rw-r--r--modules/gallery/tests/Graphics_Helper_Test.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/gallery/tests/Graphics_Helper_Test.php b/modules/gallery/tests/Graphics_Helper_Test.php
index a68822b0..2cf5caa7 100644
--- a/modules/gallery/tests/Graphics_Helper_Test.php
+++ b/modules/gallery/tests/Graphics_Helper_Test.php
@@ -77,6 +77,17 @@ class Graphics_Helper_Test extends Gallery_Unit_Test_Case {
$this->assert_equal(0, $album->thumb_dirty);
}
+ public function generate_album_cover_for_empty_album_test() {
+ $album = test::random_album();
+ // Check that the album cover is the missing image placeholder
+ $this->assert_same(file_get_contents(MODPATH . "gallery/images/missing_album_cover.jpg"),
+ file_get_contents($album->thumb_path()));
+ // Check that the items table got updated with new metadata
+ $this->assert_equal(array(200, 200), array($album->thumb_width, $album->thumb_height));
+ // Check that the image is *not* marked as dirty
+ $this->assert_equal(0, $album->thumb_dirty);
+ }
+
public function generate_bad_photo_test() {
$photo = test::random_photo();
// At this point, the photo is valid and has a valid resize and thumb. Make it garble.