public function FeedsWebTestCase::editFeedNode in Feeds 6
Same name and namespace in other branches
- 7.2 tests/feeds.test \FeedsWebTestCase::editFeedNode()
- 7 tests/feeds.test.inc \FeedsWebTestCase::editFeedNode()
Edit the configuration of a feed node to test update behavior.
Parameters
$nid: The nid to edit.
$feed_url: The new (absolute) feed URL to use.
$title: Optional parameter to change title of feed node.
1 call to FeedsWebTestCase::editFeedNode()
- FeedsRSStoNodesTest::test in tests/
feeds_processor_node.test - Test node creation, refreshing/deleting feeds and feed items.
File
- tests/
feeds.test, line 231 - Common functionality for all Feeds tests.
Class
- FeedsWebTestCase
- Test basic Data API functionality.
Code
public function editFeedNode($nid, $feed_url, $title = '') {
$edit = array(
'title' => $title,
'feeds[FeedsHTTPFetcher][source]' => $feed_url,
);
// Check that the update was saved.
$this
->drupalPost('node/' . $nid . '/edit', $edit, 'Save');
$this
->assertText('has been updated.');
// Check that the URL was updated in the feeds_source table.
$source = db_fetch_object(db_query("SELECT * FROM {feeds_source} WHERE feed_nid = %d", $nid));
$config = unserialize($source->config);
$this
->assertEqual($config['FeedsHTTPFetcher']['source'], $feed_url, t('URL in DB correct.'));
}