diff options
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r-- | modules/gallery/tests/Album_Helper_Test.php | 3 | ||||
-rw-r--r-- | modules/gallery/tests/File_Structure_Test.php | 21 | ||||
-rw-r--r-- | modules/gallery/tests/Gallery_Installer_Test.php (renamed from modules/gallery/tests/Core_Installer_Test.php) | 0 | ||||
-rw-r--r-- | modules/gallery/tests/Photo_Helper_Test.php | 2 |
4 files changed, 18 insertions, 8 deletions
diff --git a/modules/gallery/tests/Album_Helper_Test.php b/modules/gallery/tests/Album_Helper_Test.php index 80afa8d1..2080ef30 100644 --- a/modules/gallery/tests/Album_Helper_Test.php +++ b/modules/gallery/tests/Album_Helper_Test.php @@ -49,7 +49,8 @@ class Album_Helper_Test extends Unit_Test_Case { $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()); + $this->assert_equal( + "http://./var/thumbs/$rand/.album.jpg?m={$album->updated}", $album->thumb_url()); } public function resize_url_test() { diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 017b1950..c517bd72 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -91,6 +91,18 @@ class File_Structure_Test extends Unit_Test_Case { $fp = fopen($path, "r"); $actual = array(fgets($fp)); fclose($fp); + } else if (strpos($path, DOCROOT . "var/logs") === 0) { + // var/logs has the kohana one-liner preamble + $expected = array("<?php defined('SYSPATH') or die('No direct script access.'); ?>\n"); + $fp = fopen($path, "r"); + $actual = array(fgets($fp)); + fclose($fp); + } else if (strpos($path, DOCROOT . "var") === 0) { + // Anything else under var has the Gallery one-liner + $expected = array("<?php defined(\"SYSPATH\") or die(\"No direct script access.\") ?>\n"); + $fp = fopen($path, "r"); + $actual = array(fgets($fp)); + fclose($fp); } else { // Gallery: we care about the entire copyright $actual = $this->_get_preamble($path); @@ -141,14 +153,12 @@ class File_Structure_Test extends Unit_Test_Case { // Front controllers break; - case DOCROOT . "index.local.php": + case DOCROOT . "local.php": // Special case optional file, not part of the codebase break; default: - if (strpos($path, DOCROOT . "var/logs") === 0) { - continue; - } else if (preg_match("/views/", $path)) { + if (preg_match("/views/", $path)) { $this->_check_view_preamble($path, $errors); } else { $this->_check_php_preamble($path, $errors); @@ -207,8 +217,7 @@ class File_Structure_Test extends Unit_Test_Case { class PhpCodeFilterIterator extends FilterIterator { public function accept() { $path_name = $this->getInnerIterator()->getPathName(); - return (substr($path_name, -4) == ".php" && - !(strpos($path_name, VARPATH) === 0)); + return substr($path_name, -4) == ".php"; } } diff --git a/modules/gallery/tests/Core_Installer_Test.php b/modules/gallery/tests/Gallery_Installer_Test.php index 24d24b38..24d24b38 100644 --- a/modules/gallery/tests/Core_Installer_Test.php +++ b/modules/gallery/tests/Gallery_Installer_Test.php diff --git a/modules/gallery/tests/Photo_Helper_Test.php b/modules/gallery/tests/Photo_Helper_Test.php index 2a6693e1..cc1f20da 100644 --- a/modules/gallery/tests/Photo_Helper_Test.php +++ b/modules/gallery/tests/Photo_Helper_Test.php @@ -69,7 +69,7 @@ class Photo_Helper_Test extends Unit_Test_Case { $rand = rand(); $root = ORM::factory("item", 1); $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand); - $this->assert_equal("http://./var/thumbs/{$rand}.jpg", $photo->thumb_url()); + $this->assert_equal("http://./var/thumbs/{$rand}.jpg?m={$photo->updated}", $photo->thumb_url()); } public function resize_url_test() { |