You are here

function SimplenewsTestCase::randomEmail in Simplenews 7.2

Same name and namespace in other branches
  1. 6.2 tests/simplenews.test \SimplenewsTestCase::randomEmail()
  2. 7 tests/simplenews.test \SimplenewsTestCase::randomEmail()

Generates a random email address.

The generated addresses are stored in a class variable. Each generated adress is checked against this store to prevent duplicates.

@todo: Make this function redundant by modification of Simplenews. Email addresses are case sensitive, simplenews system should handle with this correctly.

9 calls to SimplenewsTestCase::randomEmail()
SimpleNewsAdministrationTestCase::testNewsletterSettings in tests/simplenews.test
Test various combinations of newsletter settings.
SimpleNewsAdministrationTestCase::testSubscriptionManagement in tests/simplenews.test
Test newsletter subscription management.
SimpleNewsI18nTestCase::testNewsletterIssueTranslation in tests/simplenews.test
SimplenewsSourceTestCase::testSendHidden in tests/simplenews.test
Send a issue with the newsletter set to hidden.
SimplenewsSourceTestCase::testSendHTML in tests/simplenews.test
Send a newsletter with the HTML format.

... See full list

File

tests/simplenews.test, line 76
Simplenews test functions.

Class

SimplenewsTestCase
@file Simplenews test functions.

Code

function randomEmail($number = 4, $prefix = 'simpletest_', $domain = 'example.com') {
  $mail = '';
  do {
    $mail = drupal_strtolower($this
      ->randomName($number, $prefix) . '@' . $domain);
  } while (in_array($mail, $this->mailadress_cache));
  $this->mailadress_cache[] = $mail;
  return $mail;
}