function MessageSubscribeEmailSubscribersTest::setUp in Message Subscribe 7
Sets up a Drupal site for running functional and integration tests.
Generates a random database prefix and installs Drupal with the specified installation profile in DrupalWebTestCase::$profile into the prefixed database. Afterwards, installs any additional modules specified by the test.
After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.
Parameters
...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.
Overrides MessageSubscribeEmailTestHelper::setUp
See also
DrupalWebTestCase::prepareDatabasePrefix()
DrupalWebTestCase::changeDatabasePrefix()
DrupalWebTestCase::prepareEnvironment()
File
- message_subscribe_email/
message_subscribe_email.test, line 79 - Test for the Message subscribe email module.
Class
- MessageSubscribeEmailSubscribersTest
- Test getting email subscribes from context.
Code
function setUp() {
parent::setUp();
// Opt out of default email notifications.
$wrapper = entity_metadata_wrapper('user', $this->user1);
$wrapper->message_subscribe_email
->set(FALSE);
$wrapper = entity_metadata_wrapper('user', $this->user2);
$wrapper->message_subscribe_email
->set(FALSE);
flag('flag', 'subscribe_node', $this->node->nid, $this->user1);
flag('flag', 'subscribe_node', $this->node->nid, $this->user2);
flag('flag', 'email_node', $this->node->nid, $this->user1);
// Override default notifiers.
variable_set('message_subscribe_default_notifiers', array());
}