summaryrefslogtreecommitdiff
path: root/core/tests/Album_Test.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-11-05 07:13:46 +0000
committerBharat Mediratta <bharat@menalto.com>2008-11-05 07:13:46 +0000
commit581e931c439a726fbd6a0b0068debd2cd76e349d (patch)
tree904e121e5ebe6c4b53587bdc91723747fe6e3561 /core/tests/Album_Test.php
parent00513a71d2091eba3110164e506c2231972a1584 (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/Album_Test.php')
-rw-r--r--core/tests/Album_Test.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/core/tests/Album_Test.php b/core/tests/Album_Test.php
index 5a41a08a..a2ab1c48 100644
--- a/core/tests/Album_Test.php
+++ b/core/tests/Album_Test.php
@@ -22,12 +22,12 @@ class Album_Test extends Unit_Test_Case {
$rand = rand();
$album = album::create(1, $rand, $rand, $rand);
- $this->assert_equal(VARPATH . "albums/$rand", $album->path());
- $this->assert_equal(VARPATH . "thumbnails/$rand", $album->thumbnail_path());
- $this->assert_equal(VARPATH . "thumbnails/$rand", $album->resize_path());
+ $this->assert_equal(VARPATH . "albums/$rand", $album->file_path());
+ $this->assert_equal(VARPATH . "resizes/$rand/.thumb.jpg", $album->thumbnail_path());
+ $this->assert_true(is_dir(VARPATH . "resizes/$rand"), "missing thumbnail dir");
- $this->assert_true(is_dir($album->path()), "missing path: {$album->path()}");
- $this->assert_true(is_dir($album->resize_path()), "missing path: {$album->resize_path()}");
+ // It's unclear that a resize makes sense for an album. But we have one.
+ $this->assert_equal(VARPATH . "resizes/$rand/.resize.jpg", $album->resize_path());
$this->assert_equal(1, $album->parent_id); // MPTT tests will cover other hierarchy checks
$this->assert_equal($rand, $album->name);
@@ -41,4 +41,16 @@ class Album_Test extends Unit_Test_Case {
$album2 = album::create(1, $rand, $rand, $rand);
$this->assert_true($album1->name != $album2->name);
}
+
+ public function thumbnail_url_test() {
+ $rand = rand();
+ $album = album::create(1, $rand, $rand, $rand);
+ $this->assert_equal("http://./var/resizes/$rand/.thumb.jpg", $album->thumbnail_url());
+ }
+
+ public function resize_url_test() {
+ $rand = rand();
+ $album = album::create(1, $rand, $rand, $rand);
+ $this->assert_equal("http://./var/resizes/$rand/.resize.jpg", $album->resize_url());
+ }
}