[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/mollom/tests/ -> mollom.test (summary)

(no description)

File Size: 2490 lines (98 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 15 classes

MollomWebTestCase:: (29 methods):
  setUp()
  tearDown()
  assertMollomWatchdogMessages()
  assertSessionID()
  resetSessionID()
  assertSessionIDInForm()
  setKeys()
  assertValidKeys()
  setProtection()
  delProtection()
  assertMollomData()
  assertNoMollomData()
  assertCaptchaField()
  assertNoCaptchaField()
  assertPrivacyLink()
  assertNoPrivacyLink()
  postCorrectCaptcha()
  postIncorrectCaptcha()
  assertSpamSubmit()
  assertHamSubmit()
  assertUnsureSubmit()
  getFieldValueByID()
  getFieldValueByName()
  getServerRecord()
  resetServerRecords()
  drupalGet()
  drupalPost()
  assertSame()
  assertNotSame()

MollomInstallationTestCase:: (3 methods):
  getInfo()
  setUp()
  testInstallationProcess()

MollomResponseTestCase:: (5 methods):
  getInfo()
  testCheckContent()
  testCheckContentSession()
  testGetImageCaptcha()
  testCheckCaptcha()

MollomAccessTestCase:: (4 methods):
  getInfo()
  testKeyPairs()
  testAdminAccessRights()
  testBypassAccess()

MollomFallbackTestCase:: (5 methods):
  getInfo()
  setUp()
  testFallbackMechanismBlock()
  testFallbackMechanismAccept()
  testFailoverMechanism()

MollomServerListRecoveryTestCase:: (2 methods):
  getInfo()
  testServerListRecovery()

MollomLanguageDetectionTestCase:: (2 methods):
  getInfo()
  testLanguageDetectionAPI()

MollomBlacklistTestCase:: (4 methods):
  getInfo()
  testUrlBlacklistAPI()
  testTextBlacklistAPI()
  testBlacklistUI()

MollomFormConfigurationTestCase:: (5 methods):
  getInfo()
  setUp()
  testFormFieldsConfiguration()
  testFormAdministration()
  testFormAlter()

MollomUserFormsTestCase:: (3 methods):
  getInfo()
  testProtectRequestPassword()
  testProtectRegisterUser()

MollomCommentFormTestCase:: (7 methods):
  getInfo()
  setUp()
  testUnprotectedCommentForm()
  testCaptchaProtectedCommentForm()
  testTextAnalysisProtectedCommentForm()
  getCommentCount()
  assertCommentCount()

MollomContactFormTestCase:: (5 methods):
  getInfo()
  setUp()
  testProtectContactUserForm()
  testProtectContactSiteForm()
  parseMollomMailReportLink()

MollomResellerTestCase:: (2 methods):
  getInfo()
  testKeyManagement()

MollomDataTestCase:: (6 methods):
  getInfo()
  setUp()
  testFormGetValues()
  testAnalysis()
  testPostIdMapping()
  testVerifyKey()

MollomReportTestCase:: (4 methods):
  getInfo()
  setUp()
  testReportComment()
  testMassReportComments()


Class: MollomWebTestCase  - X-Ref

Common base test class for Mollom tests.

setUp()   X-Ref
Set up an administrative user account and testing keys.


tearDown()   X-Ref
No description

assertMollomWatchdogMessages($no_fail_expected = TRUE)   X-Ref
Assert any watchdog messages based on their severity.

This function can be (repeatedly) invoked to assert new watchdog messages.
All watchdog messages with a higher severity than WATCHDOG_NOTICE are
considered as fails.

param: $no_fail_expected

assertSessionID($session_id)   X-Ref
Assert that the Mollom session id remains the same.

The Mollom session id is only known to one server. If we are communicating
with a different Mollom server (due to a refreshed server list or being
redirected), then we will get a new session_id.

param: $session_id

resetSessionID()   X-Ref
Reset the statically cached Mollom session id.


assertSessionIDInForm()   X-Ref
Assert a Mollom session id in a form.

This is a wrapper around assertSessionID() allows to assert that a proper
Mollom session id is found in the form contained in the internal browser
output. The usual flow is:
- drupalGet() or drupalPost() requests or submits a form.
- drupalGet() and drupalPost() invoke assertMollomWatchdogMessages()
internally, which records all new watchdog messages.
- This function, assertSessionIDInForm(), is invoked to assert that there
is a Mollom session id and, depending on the recorded watchdog messages,
that it either equals the last known session id or the new session id is
used for future comparisons in case of a server redirect.
- The return value of this function is used to invoke assertMollomData(),
to verify that the proper session id was stored in the database.

setKeys($public = MOLLOM_TEST_PUBLIC_KEY, $private = MOLLOM_TEST_PRIVATE_KEY, $reseller = MOLLOM_TEST_RESELLER_KEY)   X-Ref
Assign the Mollom API keys to internal variables and reset the server list.

param: $public
param: $private
param: $reseller

assertValidKeys()   X-Ref
Call the mollom.verifyKey function directly and check that the current
keys are valid.


setProtection($form_id, $mode = MOLLOM_MODE_ANALYSIS, $fields = NULL, $edit = array()   X-Ref
Configure Mollom protection for a given form.

param: $form_id
param: $mode
param: $fields
param: $edit

delProtection($form_id)   X-Ref
Remove Mollom protection for a given form.

param: $form_id

assertMollomData($entity, $id, $session_id = NULL)   X-Ref
Assert that Mollom session data was stored for a submission.

param: $entity
param: $id
param: $session_id

assertNoMollomData($entity, $id)   X-Ref
Assert that no Mollom session data exists for a certain entity.


assertCaptchaField()   X-Ref
Assert that the CAPTCHA field is found on the current page.


assertNoCaptchaField()   X-Ref
Assert that the CAPTCHA field is not found on the current page.


assertPrivacyLink()   X-Ref
Assert that the privacy policy link is found on the current page.


assertNoPrivacyLink()   X-Ref
Assert that the privacy policy link is not found on the current page.


postCorrectCaptcha($url, array $edit = array()   X-Ref
Test submitting a form with a correct CAPTCHA value.

param: $url
param: $edit
param: $button
param: $success_message

postIncorrectCaptcha($url, array $edit = array()   X-Ref
Test submitting a form with an incorrect CAPTCHA value.

param: $url
param: $edit
param: $button
param: $success_message

assertSpamSubmit($url, array $spam_fields, array $edit = array()   X-Ref
Test submitting a form with 'spam' values.

param: $url
param: $spam_fields
param: $edit
param: $button
param: $success_message

assertHamSubmit($url, array $ham_fields, array $edit = array()   X-Ref
Test submitting a form with 'ham' values.

param: $url
param: $ham_fields
param: $edit
param: $button
param: $success_message

assertUnsureSubmit($url, array $unsure_fields, array $edit = array()   X-Ref
Test submitting a form with unsure values and resulting CAPTCHA submissions.

param: $url
param: $unsure_fields
param: $edit
param: $button
param: $success_message

getFieldValueByID($id)   X-Ref
Retrieve a field value by ID.


getFieldValueByName($name)   X-Ref
Retrieve a field value by name.


getServerRecord($method = 'mollom.checkContent')   X-Ref
Retrieve submitted XML-RPC values from testing server implementation.

param: $method

resetServerRecords($method = 'mollom.checkContent')   X-Ref
Resets recorded XML-RPC values.

param: $method

drupalGet($path, array $options = array()   X-Ref
Wraps drupalGet() for additional watchdog message assertion.

param: $options

drupalPost($path, $edit, $submit, array $options = array()   X-Ref
Wraps drupalPost() for additional watchdog message assertion.

param: $options

assertSame($name, $first, $second)   X-Ref
Asserts that two values belonging to the same variable are equal.

Checks to see whether two values, which belong to the same variable name or
identifier, are equal and logs a readable assertion message.

param: $name
param: $first
param: $second
return:

assertNotSame($name, $first, $second)   X-Ref
Asserts that two values belonging to the same variable are not equal.

Checks to see whether two values, which belong to the same variable name or
identifier, are not equal and logs a readable assertion message.

param: $name
param: $first
param: $second
return:

Class: MollomInstallationTestCase  - X-Ref

Tests module installation and global status handling.

getInfo()   X-Ref
No description

setUp()   X-Ref
No description

testInstallationProcess()   X-Ref
Tests status handling after installation.

We walk through a regular installation of the Mollom module instead of using
setUp() to ensure that everything works as expected.

Note: Partial error messages tested here; hence, no t().

Class: MollomResponseTestCase  - X-Ref

Tests low-level XML-RPC communication with Mollom servers.

getInfo()   X-Ref
No description

testCheckContent()   X-Ref
Tests mollom.checkContent().


testCheckContentSession()   X-Ref
Tests results of mollom.checkContent() across requests for a single session.


testGetImageCaptcha()   X-Ref
Tests mollom.getImageCaptcha().


testCheckCaptcha()   X-Ref
Tests mollom.checkCaptcha().


Class: MollomAccessTestCase  - X-Ref

getInfo()   X-Ref
No description

testKeyPairs()   X-Ref
Configure an invalid key pair and ensure error message.


testAdminAccessRights()   X-Ref
Make sure that the Mollom settings page works for users with the
'administer mollom' permission but not those without
it.


testBypassAccess()   X-Ref
Tests 'bypass access' property of registered forms.


Class: MollomFallbackTestCase  - X-Ref

getInfo()   X-Ref
No description

setUp()   X-Ref
No description

testFallbackMechanismBlock()   X-Ref
Make sure that "request new password" submissions can be blocked when
the Mollom servers are unreachable.


testFallbackMechanismAccept()   X-Ref
Make sure that "request new password" submissions can be allowed when
the Mollom servers are unreachable.


testFailoverMechanism()   X-Ref
Make sure that spam protection is still active even when some of the
Mollom servers are unavailable.


Class: MollomServerListRecoveryTestCase  - X-Ref

getInfo()   X-Ref
No description

testServerListRecovery()   X-Ref
Make sure the server list is reset when the Mollom servers are unavailable or incorrect.


Class: MollomLanguageDetectionTestCase  - X-Ref

getInfo()   X-Ref
No description

testLanguageDetectionAPI()   X-Ref
Test the language detection functionality at the API level without using a web interface.


Class: MollomBlacklistTestCase  - X-Ref

Tests blacklist functionality.

The blacklists are stored on the server. These tests can fail when
different people run the tests at the same time because all tests share
the same blacklist. You can configure a custom key to avoid this.
getInfo()   X-Ref
No description

testUrlBlacklistAPI()   X-Ref
Test the URL blacklist functionality at the API level without using a web interface.


testTextBlacklistAPI()   X-Ref
Test the text blacklist functionality at the API level without using a web interface.


testBlacklistUI()   X-Ref
Test the blacklist administration interface.

We don't need to check whether the blacklisting actually works
(i.e. blocks posts) because that is tested in testTextBlacklistAPI() and
testURLBlacklistAPI().

Class: MollomFormConfigurationTestCase  - X-Ref

Tests Mollom form configuration functionality.

getInfo()   X-Ref
No description

setUp()   X-Ref
No description

testFormFieldsConfiguration()   X-Ref
Tests configuration of form fields for textual analysis.


testFormAdministration()   X-Ref
Tests default configuration, protecting, and unprotecting forms.


testFormAlter()   X-Ref
Tests programmatically, conditionally disabling Mollom.


Class: MollomUserFormsTestCase  - X-Ref

getInfo()   X-Ref
No description

testProtectRequestPassword()   X-Ref
Make sure that the request password form is protected correctly.


testProtectRegisterUser()   X-Ref
Make sure that the user registration form is protected correctly.


Class: MollomCommentFormTestCase  - X-Ref

getInfo()   X-Ref
No description

setUp()   X-Ref
No description

testUnprotectedCommentForm()   X-Ref
Make sure that the comment submission form can be unprotected.


testCaptchaProtectedCommentForm()   X-Ref
Make sure that the comment submission form can be protected by captcha only.


testTextAnalysisProtectedCommentForm()   X-Ref
Make sure that the comment submission form can be fully protected.


getCommentCount($nid)   X-Ref
Return the number of comments for a node of the given node ID.  We
can't use comment_num_all() here, because that is statically cached
and therefore will not work correctly with the SimpleTest browser.


assertCommentCount($nid, $expected, $message = '')   X-Ref
Test that the number of comments for a node matches an expected value.

param: $nid
param: $expected
param: $message

Class: MollomContactFormTestCase  - X-Ref

getInfo()   X-Ref
No description

setUp()   X-Ref
No description

testProtectContactUserForm()   X-Ref
Make sure that the user contact form is protected correctly.


testProtectContactSiteForm()   X-Ref
Make sure that the site-wide contact form is protected correctly.


parseMollomMailReportLink()   X-Ref
Returns data about the report to Mollom link in the last sent mail.

Contrary to DrupalWebTestCase::assertMail(), this function removes the last
sent mail from the internally recorded stack.

Class: MollomResellerTestCase  - X-Ref

getInfo()   X-Ref
No description

testKeyManagement()   X-Ref
Make sure that resellers can create a new site.


Class: MollomDataTestCase  - X-Ref

Tests form value processing.

getInfo()   X-Ref
No description

setUp()   X-Ref
No description

testFormGetValues()   X-Ref
Test mollom_form_get_values().


testAnalysis()   X-Ref
Test submitted post and author information for textual analysis.


testPostIdMapping()   X-Ref
Tests automated 'post_id' mapping and session data storage.

This is an atomic test to verify that a simple 'post_id' mapping defined
via hook_mollom_form_info() is sufficient for basic integration with
Mollom (without reporting).

testVerifyKey()   X-Ref
Tests data sent for mollom.verifyKey.


Class: MollomReportTestCase  - X-Ref

Tests report to Mollom functionality.

getInfo()   X-Ref
No description

setUp()   X-Ref
No description

testReportComment()   X-Ref
Tests reporting comments.


testMassReportComments()   X-Ref
Tests mass-reporting comments.




Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7