diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-18 20:14:09 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-18 20:14:09 -0800 |
commit | 38c13760afaae693af245e814b6bbe76c20fcae4 (patch) | |
tree | 3dbc3a83b67209e19e983774fb197697efd4f2e4 /modules/gallery | |
parent | 0e2f4a7a372567ba1916e2533ce24ee6e1cc7d36 (diff) |
Switch to using test::random_name() to avoid integer names.
Fix up rename_photo_test.
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/tests/Item_Model_Test.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index 12f69a34..542cf371 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -63,16 +63,14 @@ class Item_Model_Test extends Unit_Test_Case { public function rename_photo_test() { $item = test::random_photo(); + $original_name = $item->name; file_put_contents($item->thumb_path(), "thumb"); file_put_contents($item->resize_path(), "resize"); file_put_contents($item->file_path(), "file"); - $original_name = $item->name; - $new_name = rand(); - // Now rename it - $item->name = $new_name; + $item->name = ($new_name = test::random_name($item)); $item->save(); // Expected: the name changed, the name is now baked into all paths, and all files were moved. @@ -96,7 +94,7 @@ class Item_Model_Test extends Unit_Test_Case { $original_album_name = $album->name; $original_photo_name = $photo->name; - $new_album_name = rand(); + $new_album_name = test::random_name(); // Now rename the album $album->name = $new_album_name; @@ -125,7 +123,7 @@ class Item_Model_Test extends Unit_Test_Case { public function item_rename_wont_accept_slash_test() { $item = test::random_photo(); - $new_name = rand() . "/"; + $new_name = test::random_name() . "/"; try { $item->rename($new_name)->save(); |