Is there a test string like GTUBE for testing mollom?

Comments

Jo Wouters’s picture

Category: support » feature

Is this what you ask for: a test strings that makes Mollom returning the 'spam' or 'unsure' state ?

What I currently do: I copy/paste a known spam-message, and let Mollom reject it.
But as soon as Mollom starts to implement some kind of openid-based scoring board, it might affect my user-score and mark my openid as a potential spammer.

I think this feature should be supported at the server-level; so this isn't limited to the current drupal-module of Mollom.

ex. The presence of the string "MOLLOMTEST-UNSURE" or "MOLLOMTEST-SPAM" in a message would make Mollom return the 'unsure'/'spam' state without doing any additional tests or updating its internal statistics

Remark: 'MOLLOMTEST-HAM' should not be supported :-)

neclimdul’s picture

That is exactly the reason. For example, to make sure the message, theming, etc appears correctly. Making sure everything is setup correctly as well. Its got a lot of uses for admins.

Freso’s picture

Component: Miscellaneous » Code
Status: Active » Fixed

From the "full API documentation" available at Mollom's API and developer documentation:

Testing

To test a Mollom plug-in during development, Mollom allows a key to be put into ‘developer mode’. This can be done on the Mollom website by creating a key associated with a test site. After the key is created, follow the ‘edit site’ link for the site you just created, and enable the ‘developer mode’ checkbox. By doing this, API calls using this key will be treated as test calls by Mollom. If an already existing site is put into developer mode, it can take as long as 60 minutes for the changes to become effective.

When in ‘developer mode’, the checkContent method can be forced to return certain values. A specific string passed in the post body field defines what is returned. If the string spam is passed, the call will return ‘spam’ with quality 0.0; if unsure is passed, it returns ‘unsure’ with quality 0.5; and if ham is passed, it will return ‘ham’ with quality 1. Mollom will also return valid session IDs that can be used for testing.

The checkCaptcha method can also be forced to return a specific response by setting the solution field. If the field is set to the string correct, the call will return true; when it is set to incorrect, false will be returned.

The calls for requesting a CAPTCHA getImageCaptcha and getAudioCaptcha will return valid CAPTCHA sessions and URLs. The correct/incorrect responses can be faked using the checkCaptcha test mode described above.

In developer mode, the sendFeedback method will test for correct use, but will simply return ‘true’ with no further effect.

The verifyKey call can be tested using your own created developer key (this will return true), a specifically created disabled key (which has a public key value of ‘disabled-key’ and private key value of ‘disabled-key’), and a specific unknown key (which has a public key value of ‘unknown-key’ and a private key value of ‘unknown-key’). The last two cases will return exceptions.

I think the mollom.test has some example code you might be able to look at.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.