Skip to content
Snippets Groups Projects
Commit 14dd9312 authored by Jeff Geerling's avatar Jeff Geerling
Browse files

Issue #2000376: Get Tests running in D8 again.

parent edf8f55d
No related branches found
No related tags found
No related merge requests found
name: Honeypot
description: "Mitigates spam form submissions using the honeypot method."
type: module
description: Mitigates spam form submissions using the honeypot method.
package: "Spam control"
core: 8.x
configure: admin/config/content/honeypot
package: "Spam control"
\ No newline at end of file
configure: admin/config/content/honeypot
\ No newline at end of file
......@@ -269,7 +269,7 @@ function honeypot_get_time_limit($form_values = array()) {
else {
$number = db_query("SELECT COUNT(*) FROM {flood} WHERE event = :event AND identifier = :hostname AND timestamp > :time", array(
':event' => 'honeypot',
':hostname' => ip_address(),
':hostname' => Drupal::request()->getClientIp(),
':time' => time() - variable_get('honeypot_expire', 300),
))->fetchField();
}
......
......@@ -227,6 +227,9 @@ class HoneypotSettingsController implements FormInterface {
// Clear the honeypot protected forms cache.
cache_invalidate_tags(array('honeypot_protected_forms' => TRUE));
// Tell the user the settings have been saved.
drupal_set_message(t('The configuration options have been saved.'));
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\honeypot\Tests\HoneypotFormTestCase.
* Definition of Drupal\honeypot\Tests\HoneypotFormTest.
*/
namespace Drupal\honeypot\Tests;
......@@ -13,7 +13,7 @@ use Drupal\Core\Database\Database;
/**
* Test the functionality of the Honeypot module for an admin user.
*/
class HoneypotFormTestCase extends WebTestBase {
class HoneypotFormTest extends WebTestBase {
protected $admin_user;
protected $web_user;
protected $node;
......@@ -29,7 +29,7 @@ class HoneypotFormTestCase extends WebTestBase {
return array(
'name' => 'Honeypot form protections',
'description' => 'Ensure that Honeypot protects site forms properly.',
'group' => 'Form API',
'group' => 'Honeypot',
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment