You are here

protected function SimplenewsTestBase::randomEmail in Simplenews 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Functional/SimplenewsTestBase.php \Drupal\Tests\simplenews\Functional\SimplenewsTestBase::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.

20 calls to SimplenewsTestBase::randomEmail()
SimplenewsAdministrationTest::testContentTypes in tests/src/Functional/SimplenewsAdministrationTest.php
Test content type configuration.
SimplenewsAdministrationTest::testNewsletterIssuesOverview in tests/src/Functional/SimplenewsAdministrationTest.php
Test newsletter issue overview.
SimplenewsAdministrationTest::testNewsletterSettings in tests/src/Functional/SimplenewsAdministrationTest.php
Test various combinations of newsletter settings.
SimplenewsAdministrationTest::testSubscriberStatusFilter in tests/src/Functional/SimplenewsAdministrationTest.php
Test content subscription status filter in subscriber view.
SimplenewsAdministrationTest::testSubscriptionManagement in tests/src/Functional/SimplenewsAdministrationTest.php
Test newsletter subscription management.

... See full list

File

tests/src/Functional/SimplenewsTestBase.php, line 71

Class

SimplenewsTestBase
Base class for simplenews web tests.

Namespace

Drupal\Tests\simplenews\Functional

Code

protected function randomEmail($number = 4, $prefix = 'simpletest_', $domain = 'example.com') {
  $mail = mb_strtolower($this
    ->randomMachineName($number, $prefix) . '@' . $domain);
  return $mail;
}