function SimplenewsTestCase::setAnonymousUserSubscription in Simplenews 7.2
Same name and namespace in other branches
- 6.2 tests/simplenews.test \SimplenewsTestCase::setAnonymousUserSubscription()
- 7 tests/simplenews.test \SimplenewsTestCase::setAnonymousUserSubscription()
Set anonymous user permission to subscribe.
Parameters
boolean $enabled: Allow anonymous subscribing.
4 calls to SimplenewsTestCase::setAnonymousUserSubscription()
- SimplenewsSubscribeTestCase::testSubscribeAnonymous in tests/
simplenews.test - testSubscribeAnonymous
- SimplenewsSubscribeTestCase::testSubscribeAnonymousSingle in tests/
simplenews.test - Test anonymous subscription with single opt in.
- SimplenewsSubscribeTestCase::testSubscribeAuthenticated in tests/
simplenews.test - testSubscribeAuthenticated
- SimplenewsSubscribeTestCase::testSubscribeMultiple in tests/
simplenews.test - Subscribe to multiple newsletters at the same time.
File
- tests/
simplenews.test, line 42 - Simplenews test functions.
Class
- SimplenewsTestCase
- @file Simplenews test functions.
Code
function setAnonymousUserSubscription($enabled) {
if ($enabled) {
db_insert('role_permission')
->fields(array(
'rid',
'permission',
), array(
DRUPAL_ANONYMOUS_RID,
'subscribe to newsletters',
))
->execute();
}
}