diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-05 07:13:46 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-05 07:13:46 +0000 |
commit | 581e931c439a726fbd6a0b0068debd2cd76e349d (patch) | |
tree | 904e121e5ebe6c4b53587bdc91723747fe6e3561 /core/tests/Photo_Test.php | |
parent | 00513a71d2091eba3110164e506c2231972a1584 (diff) |
Change the default theme to actually render what's in the Gallery.
Currently only the album view works, albums have no thumbnails, and
there's only 1 image in use.
Improved Item_Model to have the following API methods
file_path() -- returns the path to the source image or album dir
thumbnail_path(), thumbnail_url() -- returns path/url to the thumbnail
resize_path(), resize_url() -- returns path/url to the resize
All tests updated.
Diffstat (limited to 'core/tests/Photo_Test.php')
-rw-r--r-- | core/tests/Photo_Test.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/core/tests/Photo_Test.php b/core/tests/Photo_Test.php index 8b0a48cc..0980a187 100644 --- a/core/tests/Photo_Test.php +++ b/core/tests/Photo_Test.php @@ -22,11 +22,11 @@ class Photo_Test extends Unit_Test_Case { $rand = rand(); $photo = photo::create(1, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand); - $this->assert_equal(VARPATH . "albums/$rand.jpg", $photo->path()); - $this->assert_equal(VARPATH . "thumbnails/{$rand}_thumb.jpg", $photo->thumbnail_path()); - $this->assert_equal(VARPATH . "thumbnails/{$rand}_resize.jpg", $photo->resize_path()); + $this->assert_equal(VARPATH . "albums/$rand.jpg", $photo->file_path()); + $this->assert_equal(VARPATH . "resizes/{$rand}.thumb.jpg", $photo->thumbnail_path()); + $this->assert_equal(VARPATH . "resizes/{$rand}.resize.jpg", $photo->resize_path()); - $this->assert_true(is_file($photo->path()), "missing: {$photo->path()}"); + $this->assert_true(is_file($photo->file_path()), "missing: {$photo->file_path()}"); $this->assert_true(is_file($photo->resize_path()), "missing: {$photo->resize_path()}"); $this->assert_true(is_file($photo->thumbnail_path()), "missing: {$photo->thumbnail_path()}"); @@ -54,4 +54,16 @@ class Photo_Test extends Unit_Test_Case { // pass } } + + public function thumbnail_url_test() { + $rand = rand(); + $photo = photo::create(1, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand); + $this->assert_equal("http://./var/resizes/{$rand}.thumb.jpg", $photo->thumbnail_url()); + } + + public function resize_url_test() { + $rand = rand(); + $photo = photo::create(1, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand); + $this->assert_equal("http://./var/resizes/{$rand}.resize.jpg", $photo->resize_url()); + } } |