summaryrefslogtreecommitdiff
path: root/modules/spam_filter
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-02 18:54:37 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-02 18:54:37 +0000
commit9644dcc48021b4ad9546debd399460eddd2f0612 (patch)
tree40e9a399c03ded76c2f9a9c107fc82dd1b7a2705 /modules/spam_filter
parent277e7f8db290d33bfe241641c0fa4de588e38d35 (diff)
1) Removed the published boolean database field
2) Replaced it with a string field (state) which contains the state of the comment. i.e. published, unpublished, spam. Unsure if we want to create constants in comments.php to standardize the valid values... thoughts? 3) synchronized the spamfilter and comment unit tests with the current functionality
Diffstat (limited to 'modules/spam_filter')
-rw-r--r--modules/spam_filter/libraries/SpamFilter.php2
-rw-r--r--modules/spam_filter/tests/SpamFilter_Helper_Test.php (renamed from modules/spam_filter/tests/Spam_Filter_Helper_Test.php)4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/spam_filter/libraries/SpamFilter.php b/modules/spam_filter/libraries/SpamFilter.php
index 7b826a21..3485bf75 100644
--- a/modules/spam_filter/libraries/SpamFilter.php
+++ b/modules/spam_filter/libraries/SpamFilter.php
@@ -56,7 +56,7 @@ class SpamFilter_Core {
$this->_is_initialized();
$is_valid = $this->driver->check_comment($comment);
- $comment->published = $is_valid;
+ $comment->state = $is_valid ? "published" : "spam";
return $is_valid;
}
diff --git a/modules/spam_filter/tests/Spam_Filter_Helper_Test.php b/modules/spam_filter/tests/SpamFilter_Helper_Test.php
index 8abd8ed6..7f6bf5c0 100644
--- a/modules/spam_filter/tests/Spam_Filter_Helper_Test.php
+++ b/modules/spam_filter/tests/SpamFilter_Helper_Test.php
@@ -19,11 +19,11 @@
*/
class SpamFilter_Helper_Test extends Unit_Test_Case {
public function get_driver_names_test() {
- $current_driver = module::get_var("spam_filter", "driver");
+ $expected[] = _("Select Driver");
foreach (glob(MODPATH . "spam_filter/libraries/drivers/*.php") as $file) {
if (preg_match("#spam_filter/libraries/drivers/(.*).php$#", $file, $matches)) {
if ($matches[1] != "SpamFilter") {
- $expected[$matches[1]] = $matches[1] === $current_driver;
+ $expected[] = $matches[1];
}
}
}