From 9affa8ebbd539396d71f19003b91af577a8a183e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 10 May 2010 22:11:59 -0700 Subject: Pick a new album cover when the photo that's the current cover is deleted. Fixes ticket #1083. --- modules/gallery/tests/Item_Model_Test.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/gallery/tests/Item_Model_Test.php') diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index 28d6fba7..15aa2d8c 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -363,4 +363,12 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $this->assert_true(!array_key_exists("parent_id", $result)); $this->assert_true(!array_key_exists("album_cover_item_id", $result)); } + + public function first_photo_becomes_album_cover() { + $album = test::random_album(); + $photo = test::random_photo($album); + $album->reload(); + + $this->assert_same($photo->id, $album->album_cover_item_id); + } } -- cgit v1.2.3