public function MailhandlerTestCase::createSource in Mailhandler 7.2
Same name and namespace in other branches
- 6.2 tests/mailhandler.test \MailhandlerTestCase::createSource()
Create a source node.
1 call to MailhandlerTestCase::createSource()
- MailhandlerTestCase::testMailhandlerImport in tests/
mailhandler.test - Test case.
File
- tests/
mailhandler.test, line 73 - Tests for Mailhandler modules.
Class
- MailhandlerTestCase
- Mailhandler test cases.
Code
public function createSource($prefix, $count = 0, $auth_required = FALSE) {
$edit = array();
$edit['feeds[MailhandlerFetcher][source]'] = $prefix . '_example_com';
$edit['feeds[MailhandlerParser][auth_required]'] = $auth_required;
$edit['title'] = $prefix . '@example.com';
$this
->drupalPost('node/add/mailhandler-source', $edit, t('Save'));
$text = 'There are no new nodes.';
if ($count == 1) {
$text = 'Created ' . $count . ' node.';
}
elseif ($count > 1) {
$text = 'Created ' . $count . ' nodes.';
}
$this
->assertText(t($text));
}