diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-17 21:49:48 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-17 21:49:48 -0800 |
commit | 06541f0e2a5cb9ee78b6b1553dd522dcc33a1b3d (patch) | |
tree | 06bec11847d67e89e667d33b236d48f8299a5566 | |
parent | 710e472edc95dd4b7a192348e11b81636ac83e52 (diff) |
Fix item_rename_fails_with_existing_name_test() -- broken because of
http://dev.kohanaphp.com/issues/2504
-rw-r--r-- | modules/gallery/tests/Item_Model_Test.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index a2720f7d..c4e150a6 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -141,17 +141,16 @@ class Item_Model_Test extends Unit_Test_Case { $item = test::random_photo(); $item2 = test::random_photo(); - $new_name = $item2->name; - try { - $item->rename($new_name)->save(); - } catch (Exception $e) { - // pass - $this->assert_true(strpos($e->getMessage(), "INVALID_RENAME_FILE_EXISTS") !== false, - "incorrect exception."); + $item->name = $item2->name; + $item->validate(); // @todo: switch this to save() once + // http://dev.kohanaphp.com/issues/2504 is fixed. + } catch (ORM_Validation_Exception $e) { + $this->assert_true(in_array("conflict", $e->validation->errors())); return; } - $this->assert_false(true, "Item_Model::rename should fail."); + + $this->assert_false(true, "rename should conflict"); } public function save_original_values_test() { |