mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-25 13:59:11 -04:00
#1982 - Add placeholder for albums with no album cover.
- Added missing_album_cover.jpg placeholder image. - Modified the graphics helper to use it. Calling graphics::generate will copy it. - Modified item::remove_album_cover and gallery_event::item_created to run graphics::generate. - Added unit test to Graphics_Helper_Test.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user