summaryrefslogtreecommitdiff
path: root/modules/gallery/tests/Item_Helper_Test.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-05-13 01:49:54 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-05-13 01:49:54 +0000
commita0b0b415515bff5f9edd43d373e8e78f3b3f8e4d (patch)
treea101f7a71a33f75c21d4ac828f442d902f5d8af9 /modules/gallery/tests/Item_Helper_Test.php
parent104430e9e1e8dacd5e4320e29e59fc59aa5c6ee9 (diff)
parent9affa8ebbd539396d71f19003b91af577a8a183e (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/tests/Item_Helper_Test.php')
-rw-r--r--modules/gallery/tests/Item_Helper_Test.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php
index 295871a5..4771b11a 100644
--- a/modules/gallery/tests/Item_Helper_Test.php
+++ b/modules/gallery/tests/Item_Helper_Test.php
@@ -54,7 +54,6 @@ class Item_Helper_Test extends Gallery_Unit_Test_Case {
$this->assert_same($dst_album->id, $photo->parent_id);
}
-
public function move_updates_album_covers_test() {
// 2 photos in the source album
$src_album = test::random_album();
@@ -106,4 +105,16 @@ class Item_Helper_Test extends Gallery_Unit_Test_Case {
$this->assert_not_same("{$rand}.jpg", $photo2->name);
$this->assert_not_same($rand, $photo2->slug);
}
+
+ public function delete_cover_photo_picks_new_album_cover() {
+ $album = test::random_album();
+ $photo1 = test::random_photo($album);
+ // At this point, $photo1 is the album cover. We verify this in
+ // Item_Model_Test::first_photo_becomes_album_cover
+ $photo2 = test::random_photo($album);
+ $photo1->delete();
+ $album->reload();
+
+ $this->assert_same($photo2->id, $album->album_cover_item_id);
+ }
}