diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-27 21:52:18 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-27 21:52:18 -0800 |
commit | 212633d05a5a8abb77a744a69c61d6e3051b73c5 (patch) | |
tree | f434444e950bc2bed16b6e15b4bb0c373aa6dfd1 /modules/gallery/tests/Item_Model_Test.php | |
parent | ec0f89f10a58c3c3751387d5c1d1efcbf940bc9a (diff) |
Prevent accidentally deleting the root album.
Diffstat (limited to 'modules/gallery/tests/Item_Model_Test.php')
-rw-r--r-- | modules/gallery/tests/Item_Model_Test.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index 1e77076a..eb9ecc99 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -336,4 +336,14 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { } $this->assert_true(false, "Shouldn't get here"); } + + public function cant_delete_root_album_test() { + try { + item::root()->delete(); + } catch (ORM_Validation_Exception $e) { + $this->assert_same(array("id" => "cant_delete_root_album"), $e->validation->errors()); + return; // pass + } + $this->assert_true(false, "Shouldn't get here"); + } } |