public function SimpleNewsUpgradePathTestCase::assertUpgradePath in Simplenews 7.2
Same name and namespace in other branches
- 7 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 2025
- 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';
$newsletter_id = 1;
module_load_include('module', 'simplenews');
simplenews_subscribe($mail, $newsletter_id, 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', 'dummy'), 'dummy');
$this
->assertFalse(field_info_instance('node', 'taxonomy_vocabulary_1', 'simplenews'));
$edit = array(
'title' => $this
->randomName(),
);
$this
->drupalPost(NULL, $edit, 'Save');
$this
->clickLink(t('Newsletter'));
$this
->drupalPost(NULL, array(), t('Submit'));
entity_get_controller('node')
->resetCache(array(
2,
));
$node = node_load(2);
$this
->assertEqual(1, simplenews_issue_newsletter_id($node), 'There is an issue associated to the correct newsletter');
$edit = array(
'name' => $this
->randomName(),
);
$this
->drupalPost('admin/config/services/simplenews/add', $edit, t('Save'));
$this
->assertResponse(200);
$this
->assertText($edit['name']);
}