You are here

public function NewsletterTemplateTestCase::testNewsletterTemplateEdit in Newsletter 7.2

Same name and namespace in other branches
  1. 7 newsletter.test \NewsletterTemplateTestCase::testNewsletterTemplateEdit()

File

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

Class

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

Code

public function testNewsletterTemplateEdit() {

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

  // Edit the Default template.
  $edit = array();
  $edit['subject'] = $this
    ->randomName(8);
  $edit['field_newsletter_body[' . LANGUAGE_NONE . '][0][value]'] = $this
    ->randomString(1000);
  $edit['field_' . $vocabulary->machine_name . '[' . LANGUAGE_NONE . '][]'] = $term->tid;
  $edit['exposed'] = 1;
  $this
    ->drupalPost('admin/config/media/newsletter/templates/edit/4', $edit, t('Update'));
  $this
    ->assertText(t('Template updated successfully'));
}