You are here

function MailhandlerTestCase::drupalCreateMailbox in Mailhandler 6

Create a mailbox in the database.

Parameters

$mailbox: associative array with mailbox settings.

Return value

array updated mailbox with mid.

File

./mailhandler.test, line 297
Simpletest case for mailhandler module.

Class

MailhandlerTestCase
Functionality tests for mailhandler module.

Code

function drupalCreateMailbox($mailbox = array()) {

  // Populate defaults array.
  $mailbox += array(
    'mail' => $this
      ->randomName() . '@simpletest.tld',
    'mailto' => '',
    'folder' => $this->tempdir,
    'imap' => 0,
    'domain' => '',
    'port' => '',
    'name' => '',
    'pass' => '',
    'extraimap' => '',
    'mime' => 'TEXT/HTML,TEXT/PLAIN',
    'security' => 0,
    'replies' => 1,
    'fromheader' => '',
    'commands' => '',
    'sigseparator' => '',
    'delete_after_read' => 1,
    'enabled' => 1,
    'format' => variable_get('filter_default_format', 1),
    'authentication' => '',
  );
  drupal_write_record('mailhandler', $mailbox);
  return $mailbox;
}