summaryrefslogtreecommitdiff
path: root/modules/gallery/tests
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r--modules/gallery/tests/Core_Installer_Test.php12
-rw-r--r--modules/gallery/tests/File_Structure_Test.php2
-rw-r--r--modules/gallery/tests/Movie_Helper_Test.php4
-rw-r--r--modules/gallery/tests/Photo_Helper_Test.php14
-rw-r--r--modules/gallery/tests/Photos_Controller_Test.php4
-rw-r--r--modules/gallery/tests/Var_Test.php32
6 files changed, 34 insertions, 34 deletions
diff --git a/modules/gallery/tests/Core_Installer_Test.php b/modules/gallery/tests/Core_Installer_Test.php
index f7036286..24d24b38 100644
--- a/modules/gallery/tests/Core_Installer_Test.php
+++ b/modules/gallery/tests/Core_Installer_Test.php
@@ -19,21 +19,21 @@
*/
/**
- * This test case operates under the assumption that core_installer::install() is called by the
+ * This test case operates under the assumption that gallery_installer::install() is called by the
* test controller before it starts.
*/
-class Core_Installer_Test extends Unit_Test_Case {
+class Gallery_Installer_Test extends Unit_Test_Case {
public function install_creates_dirs_test() {
$this->assert_true(file_exists(VARPATH . "albums"));
$this->assert_true(file_exists(VARPATH . "resizes"));
}
- public function install_registers_core_module_test() {
- $core = ORM::factory("module")->where("name", "core")->find();
- $this->assert_equal("core", $core->name);
+ public function install_registers_gallery_module_test() {
+ $gallery = ORM::factory("module")->where("name", "gallery")->find();
+ $this->assert_equal("gallery", $gallery->name);
// This is probably too volatile to keep for long
- $this->assert_equal(1, $core->version);
+ $this->assert_equal(1, $gallery->version);
}
public function install_creates_root_item_test() {
diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php
index 1caa82ba..3b8c754f 100644
--- a/modules/gallery/tests/File_Structure_Test.php
+++ b/modules/gallery/tests/File_Structure_Test.php
@@ -218,11 +218,11 @@ class GalleryCodeFilterIterator extends FilterIterator {
$path_name = $this->getInnerIterator()->getPathName();
return !(
strpos($path_name, ".svn") ||
- strpos($path_name, "core/views/kohana_profiler.php") !== false ||
strpos($path_name, DOCROOT . "test") !== false ||
strpos($path_name, DOCROOT . "var") !== false ||
strpos($path_name, MODPATH . "forge") !== false ||
strpos($path_name, APPPATH . "views/kohana_error_page.php") !== false ||
+ strpos($path_name, MODPATH . "gallery/views/kohana_profiler.php") !== false ||
strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_error_page.php") !== false ||
strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_unit_test_cli.php") !== false ||
strpos($path_name, MODPATH . "unit_test") !== false ||
diff --git a/modules/gallery/tests/Movie_Helper_Test.php b/modules/gallery/tests/Movie_Helper_Test.php
index b92ef3f8..627651bb 100644
--- a/modules/gallery/tests/Movie_Helper_Test.php
+++ b/modules/gallery/tests/Movie_Helper_Test.php
@@ -22,7 +22,7 @@ class Movie_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
try {
- $movie = movie::create($root, DOCROOT . "core/tests/test.jpg", "$rand/.jpg", $rand, $rand);
+ $movie = movie::create($root, MODPATH . "gallery/tests/test.jpg", "$rand/.jpg", $rand, $rand);
} catch (Exception $e) {
// pass
return;
@@ -35,7 +35,7 @@ class Movie_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
try {
- $movie = movie::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg.", $rand, $rand);
+ $movie = movie::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg.", $rand, $rand);
} catch (Exception $e) {
$this->assert_equal("@todo NAME_CANNOT_END_IN_PERIOD", $e->getMessage());
return;
diff --git a/modules/gallery/tests/Photo_Helper_Test.php b/modules/gallery/tests/Photo_Helper_Test.php
index deb11bb9..2a6693e1 100644
--- a/modules/gallery/tests/Photo_Helper_Test.php
+++ b/modules/gallery/tests/Photo_Helper_Test.php
@@ -21,7 +21,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
public function create_photo_test() {
$rand = rand();
- $filename = DOCROOT . "core/tests/test.jpg";
+ $filename = MODPATH . "gallery/tests/test.jpg";
$image_info = getimagesize($filename);
$root = ORM::factory("item", 1);
@@ -50,8 +50,8 @@ class Photo_Helper_Test extends Unit_Test_Case {
public function create_conflicting_photo_test() {
$rand = rand();
$root = ORM::factory("item", 1);
- $photo1 = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand);
- $photo2 = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ $photo1 = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ $photo2 = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
$this->assert_true($photo1->name != $photo2->name);
}
@@ -68,7 +68,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
public function thumb_url_test() {
$rand = rand();
$root = ORM::factory("item", 1);
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
$this->assert_equal("http://./var/thumbs/{$rand}.jpg", $photo->thumb_url());
}
@@ -76,7 +76,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
$album = album::create($root, $rand, $rand, $rand);
- $photo = photo::create($album, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ $photo = photo::create($album, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
$this->assert_equal("http://./var/resizes/{$rand}/{$rand}.jpg", $photo->resize_url());
}
@@ -85,7 +85,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
try {
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand/.jpg", $rand, $rand);
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand/.jpg", $rand, $rand);
} catch (Exception $e) {
// pass
return;
@@ -98,7 +98,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
try {
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg.", $rand, $rand);
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg.", $rand, $rand);
} catch (Exception $e) {
$this->assert_equal("@todo NAME_CANNOT_END_IN_PERIOD", $e->getMessage());
return;
diff --git a/modules/gallery/tests/Photos_Controller_Test.php b/modules/gallery/tests/Photos_Controller_Test.php
index 71319315..771cc90d 100644
--- a/modules/gallery/tests/Photos_Controller_Test.php
+++ b/modules/gallery/tests/Photos_Controller_Test.php
@@ -29,7 +29,7 @@ class Photos_Controller_Test extends Unit_Test_Case {
public function change_photo_test() {
$controller = new Photos_Controller();
$root = ORM::factory("item", 1);
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "test.jpeg", "test", "test");
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "test.jpeg", "test", "test");
$orig_name = $photo->name;
$_POST["filename"] = "test.jpeg";
@@ -58,7 +58,7 @@ class Photos_Controller_Test extends Unit_Test_Case {
public function change_photo_no_csrf_fails_test() {
$controller = new Photos_Controller();
$root = ORM::factory("item", 1);
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "test", "test", "test");
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "test", "test", "test");
$_POST["name"] = "new name";
$_POST["title"] = "new title";
$_POST["description"] = "new description";
diff --git a/modules/gallery/tests/Var_Test.php b/modules/gallery/tests/Var_Test.php
index 82370631..355d94a7 100644
--- a/modules/gallery/tests/Var_Test.php
+++ b/modules/gallery/tests/Var_Test.php
@@ -19,31 +19,31 @@
*/
class Var_Test extends Unit_Test_Case {
public function add_parameter_test() {
- module::set_var("core", "Parameter", "original value");
- $this->assert_equal("original value", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "original value");
+ $this->assert_equal("original value", module::get_var("gallery", "Parameter"));
- module::set_var("core", "Parameter", "updated value");
- $this->assert_equal("updated value", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "updated value");
+ $this->assert_equal("updated value", module::get_var("gallery", "Parameter"));
}
public function clear_parameter_test() {
- module::set_var("core", "Parameter", "original value");
- $this->assert_equal("original value", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "original value");
+ $this->assert_equal("original value", module::get_var("gallery", "Parameter"));
- module::clear_var("core", "Parameter");
- $this->assert_equal(null, module::get_var("core", "Parameter"));
+ module::clear_var("gallery", "Parameter");
+ $this->assert_equal(null, module::get_var("gallery", "Parameter"));
}
public function incr_parameter_test() {
- module::set_var("core", "Parameter", "original value");
- module::incr_var("core", "Parameter");
- $this->assert_equal("1", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "original value");
+ module::incr_var("gallery", "Parameter");
+ $this->assert_equal("1", module::get_var("gallery", "Parameter"));
- module::set_var("core", "Parameter", "2");
- module::incr_var("core", "Parameter", "9");
- $this->assert_equal("11", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "2");
+ module::incr_var("gallery", "Parameter", "9");
+ $this->assert_equal("11", module::get_var("gallery", "Parameter"));
- module::incr_var("core", "NonExistent", "9");
- $this->assert_equal(null, module::get_var("core", "NonExistent"));
+ module::incr_var("gallery", "NonExistent", "9");
+ $this->assert_equal(null, module::get_var("gallery", "NonExistent"));
}
} \ No newline at end of file