You are here

function SimplenewsTestCase::getRandomNewsletter in Simplenews 7.2

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

Select randomly one of the available newsletters.

Return value

newsletter newsletter_id.

7 calls to SimplenewsTestCase::getRandomNewsletter()
SimpleNewsAdministrationTestCase::testSubscriptionManagement in tests/simplenews.test
Test newsletter subscription management.
SimpleNewsI18nTestCase::testNewsletterIssueTranslation in tests/simplenews.test
SimplenewsSendTestCase::testProgrammaticNewsletter in tests/simplenews.test
Creates and sends a node using the API.
SimplenewsSendTestCase::testUpdateNewsletter in tests/simplenews.test
SimplenewsSourceTestCase::testSendCaching in tests/simplenews.test
Test sending a newsletter to 100 recipients with caching enabled.

... See full list

File

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

Class

SimplenewsTestCase
@file Simplenews test functions.

Code

function getRandomNewsletter() {
  if ($newsletters = array_keys(simplenews_newsletter_get_all())) {
    return $newsletters[array_rand($newsletters)];
  }
  return 0;
}