diff options
| author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-05-13 01:49:54 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-05-13 01:49:54 +0000 |
| commit | a0b0b415515bff5f9edd43d373e8e78f3b3f8e4d (patch) | |
| tree | a101f7a71a33f75c21d4ac828f442d902f5d8af9 /modules/gallery/tests/Item_Model_Test.php | |
| parent | 104430e9e1e8dacd5e4320e29e59fc59aa5c6ee9 (diff) | |
| parent | 9affa8ebbd539396d71f19003b91af577a8a183e (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.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index d0676292..15aa2d8c 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -295,7 +295,6 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { } catch (ORM_Validation_Exception $e) { $this->assert_same(array("description" => "length", "name" => "required", - "slug" => "required", "title" => "required", "album_cover_item_id" => "invalid_item", "parent_id" => "invalid", @@ -324,6 +323,12 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $album->save(); } + public function name_with_only_invalid_chars_is_still_valid_test() { + $album = test::random_album_unsaved(); + $album->name = "[]"; + $album->save(); + } + public function cant_change_item_type_test() { $photo = test::random_photo(); try { @@ -358,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); + } } |
