diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2008-12-23 04:36:09 +0000 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-23 04:36:09 +0000 |
| commit | 5713e3c66ed8bab3b86490d7b6e90f7947d53429 (patch) | |
| tree | e6a4f5e93dd15406c655c7b51d455c5181d3334c /core/tests/Album_Helper_Test.php | |
| parent | 2502240ce4ad25e9fb60ee2468764e25346d2917 (diff) | |
Change photo::create() and album::create() to take ORM instances
instead of ids.
Diffstat (limited to 'core/tests/Album_Helper_Test.php')
| -rw-r--r-- | core/tests/Album_Helper_Test.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/tests/Album_Helper_Test.php b/core/tests/Album_Helper_Test.php index 1d9388d9..d085ca88 100644 --- a/core/tests/Album_Helper_Test.php +++ b/core/tests/Album_Helper_Test.php @@ -20,7 +20,8 @@ class Album_Helper_Test extends Unit_Test_Case { public function create_album_test() { $rand = rand(); - $album = album::create(1, $rand, $rand, $rand); + $root = ORM::factory("item", 1); + $album = album::create($root, $rand, $rand, $rand); $this->assert_equal(VARPATH . "albums/$rand", $album->file_path()); $this->assert_equal(VARPATH . "thumbs/$rand/.album.jpg", $album->thumb_path()); @@ -38,20 +39,23 @@ class Album_Helper_Test extends Unit_Test_Case { public function create_conflicting_album_test() { $rand = rand(); - $album1 = album::create(1, $rand, $rand, $rand); - $album2 = album::create(1, $rand, $rand, $rand); + $root = ORM::factory("item", 1); + $album1 = album::create($root, $rand, $rand, $rand); + $album2 = album::create($root, $rand, $rand, $rand); $this->assert_true($album1->name != $album2->name); } public function thumb_url_test() { $rand = rand(); - $album = album::create(1, $rand, $rand, $rand); + $root = ORM::factory("item", 1); + $album = album::create($root, $rand, $rand, $rand); $this->assert_equal("http://./var/thumbs/$rand/.album.jpg", $album->thumb_url()); } public function resize_url_test() { $rand = rand(); - $album = album::create(1, $rand, $rand, $rand); + $root = ORM::factory("item", 1); + $album = album::create($root, $rand, $rand, $rand); $this->assert_equal("http://./var/resizes/$rand/.album.jpg", $album->resize_url()); } } |
