public function SimpleNewsUpgradePathTestCase::assertUpgradePath in Simplenews 7
Same name and namespace in other branches
- 7.2 tests/simplenews.test \SimpleNewsUpgradePathTestCase::assertUpgradePath()
2 calls to SimpleNewsUpgradePathTestCase::assertUpgradePath()
- SimpleNewsUpgradePath61TestCase::testSimplenewsUpgrade in tests/simplenews.test
- Test a successful upgrade.
- SimpleNewsUpgradePath62TestCase::testSimplenewsUpgrade in tests/simplenews.test
- Test a successful upgrade.
File
- tests/simplenews.test, line 1891
- Simplenews test functions.
Class
- SimpleNewsUpgradePathTestCase
Code
public function assertUpgradePath() {
$edit = array(
'modules[Mail][simplenews][enable]' => 1,
);
$this
->drupalPost('admin/modules', $edit, t('Save configuration'));
$mail = 'new@example.org';
$tid = 1;
module_load_include('module', 'simplenews');
simplenews_subscribe_user($mail, $tid, FALSE);
$this
->drupalGet('admin/config/services/simplenews');
$this
->assertText('Drupal 6 newsletter');
$this
->assertText('Test');
$this
->drupalGet('admin/people/simplenews');
$this
->assertText('another@example.org');
$this
->assertText($mail);
$this
->drupalGet('admin/structure/taxonomy/newsletter');
$this
->drupalGet('admin/structure/types/manage/simplenews');
$this
->assertFieldChecked('edit-simplenews-content-type');
$this
->drupalGet('admin/structure/types/manage/simplenews/fields');
$this
->drupalGet('node/add/simplenews');
$this
->assertText('Newsletter');
$this
->assertText('Drupal 6 newsletter');
$this
->assertEqual(variable_get('simplenews_category_field'), 'taxonomy_vocabulary_1');
$this
->assertTrue(field_info_instance('node', 'taxonomy_vocabulary_1', 'simplenews'));
$edit = array(
'title' => $this
->randomName(),
'taxonomy_vocabulary_1[und]' => 1,
);
$this
->drupalPost(NULL, $edit, 'Save');
$this
->clickLink(t('Newsletter'));
$this
->drupalPost(NULL, array(), t('Submit'));
$this
->assertEqual(1, db_query('SELECT tid FROM {simplenews_newsletter} WHERE nid = :nid', array(
':nid' => 2,
))
->fetchField(), 'There is an issue associated to the correct newsletter category');
$edit = array(
'name' => $this
->randomName(),
);
$this
->drupalPost('admin/config/services/simplenews/add', $edit, t('Save'));
$this
->assertResponse(200);
$this
->assertText($edit['name']);
}