You are here

public function MailhandlerTestCase::createMailbox in Mailhandler 7.2

Same name and namespace in other branches
  1. 6.2 tests/mailhandler.test \MailhandlerTestCase::createMailbox()

Create a mailbox given a prefix.

1 call to MailhandlerTestCase::createMailbox()
MailhandlerTestCase::createMailboxes in tests/mailhandler.test
Create mailboxes for every mbox in directory.

File

tests/mailhandler.test, line 46
Tests for Mailhandler modules.

Class

MailhandlerTestCase
Mailhandler test cases.

Code

public function createMailbox($prefix) {
  $edit = array();
  $edit['admin_title'] = $prefix . '@example.com';
  $edit['mail'] = $prefix . '_example_com';
  $edit['settings[type]'] = 'local';
  $edit['settings[folder]'] = file_directory_temp() . '/mailhandler_test/' . $prefix;
  $edit['settings[flag_after_read]'] = FALSE;
  $edit['settings[delete_after_read]'] = FALSE;
  $this
    ->drupalPost(MAILHANDLER_MENU_PREFIX . '/mailhandler/add', $edit, t('Save'));
  $this
    ->assertText(t('@title has been created.', array(
    '@title' => $prefix . '_example_com',
  )));
}