diff options
| author | root <root@sleepydogs.net> | 2009-09-13 09:01:55 -0700 |
|---|---|---|
| committer | root <root@sleepydogs.net> | 2009-09-13 09:01:55 -0700 |
| commit | c62d1f440f077ba806b7ff0c6b90ef89c79b2fd3 (patch) | |
| tree | b64f05e2a7bd8db7200e3c407904e255826b4cf2 /modules/gallery/tests/Photo_Helper_Test.php | |
| parent | b96ac1eb81b7ccd5bd050ffab0ca9ce1feec8f4f (diff) | |
| parent | caa2002d7777e0ceb884d4c628650804620ca2b6 (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/tests/Photo_Helper_Test.php')
| -rw-r--r-- | modules/gallery/tests/Photo_Helper_Test.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/gallery/tests/Photo_Helper_Test.php b/modules/gallery/tests/Photo_Helper_Test.php index cc1f20da..da455bf8 100644 --- a/modules/gallery/tests/Photo_Helper_Test.php +++ b/modules/gallery/tests/Photo_Helper_Test.php @@ -43,8 +43,8 @@ class Photo_Helper_Test extends Unit_Test_Case { $this->assert_equal($image_info[0], $photo->width); $this->assert_equal($image_info[1], $photo->height); - $this->assert_equal($photo->parent()->right - 2, $photo->left); - $this->assert_equal($photo->parent()->right - 1, $photo->right); + $this->assert_equal($photo->parent()->right_ptr - 2, $photo->left_ptr); + $this->assert_equal($photo->parent()->right_ptr - 1, $photo->right_ptr); } public function create_conflicting_photo_test() { @@ -81,6 +81,16 @@ class Photo_Helper_Test extends Unit_Test_Case { $this->assert_equal("http://./var/resizes/{$rand}/{$rand}.jpg", $photo->resize_url()); } + public function create_photo_creates_reasonable_slug_test() { + $rand = rand(); + $root = ORM::factory("item", 1); + $album = album::create($root, $rand, $rand, $rand); + $photo = photo::create( + $album, MODPATH . "gallery/tests/test.jpg", "This (is) my file%name.jpg", $rand, $rand); + + $this->assert_equal("This-is-my-file-name", $photo->slug); + } + public function create_photo_shouldnt_allow_names_with_slash_test() { $rand = rand(); $root = ORM::factory("item", 1); |
