You are here

public function NewsletterTemplateTestCase::testNewsletterTemplateCreate in Newsletter 7.2

Same name and namespace in other branches
  1. 7 newsletter.test \NewsletterTemplateTestCase::testNewsletterTemplateCreate()
1 call to NewsletterTemplateTestCase::testNewsletterTemplateCreate()
NewsletterTemplateTestCase::testNewsletterTemplateDeleteMass in ./newsletter.test

File

./newsletter.test, line 35
Tests for Newsletter module.

Class

NewsletterTemplateTestCase
The NewsletterTemplateTestCase tests CUD actions through Web UI for newsletter templates.

Code

public function testNewsletterTemplateCreate() {

  // Create a vocabulary with a term in it first.
  $vocabulary = $this
    ->createVocabulary();
  $term = $this
    ->createTerm($vocabulary);

  // Create a template.
  $create = array();
  $create['subject'] = $this
    ->randomName(8);
  $create['field_newsletter_body[' . LANGUAGE_NONE . '][0][value]'] = $this
    ->randomString(1000);
  $create['field_' . $vocabulary->machine_name . '[' . LANGUAGE_NONE . '][]'] = $term->tid;
  $this
    ->drupalPost('admin/config/media/newsletter/templates/mail/add', $create, t('Save'));
  $this
    ->assertText(t('Template updated successfully'));
}