Commit aeaeb17c authored by Dries's avatar Dries

- Patch #312316 by Aron Novak: extend aggregator module tests.

parent 72e81af1
...@@ -276,26 +276,32 @@ class UpdateFeedTestCase extends AggregatorTestCase { ...@@ -276,26 +276,32 @@ class UpdateFeedTestCase extends AggregatorTestCase {
* Create a feed and attempt to update it. * Create a feed and attempt to update it.
*/ */
function testUpdateFeed() { function testUpdateFeed() {
$feed = $this->createFeed(); $remamining_fields = array('title', 'url', '');
foreach ($remamining_fields as $same_field) {
$feed = $this->createFeed();
// Get new feed data array and modify newly created feed.
$edit = $this->getFeedEditArray();
$edit['refresh'] = 1800; // Change refresh value.
if (isset($feed->{$same_field})) {
$edit[$same_field] = $feed->{$same_field};
}
$this->drupalPost('admin/content/aggregator/edit/feed/' . $feed->fid, $edit, t('Save'));
$this->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title'])), t('The feed %name has been updated.', array('%name' => $edit['title'])));
// Get new feed data array and modify newly created feed. // Check feed data.
$edit = $this->getFeedEditArray(); $this->assertEqual($this->getUrl(), url('admin/content/aggregator/', array('absolute' => TRUE)));
$edit['refresh'] = 1800; // Change refresh value. $this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), t('The feed is unique.'));
$this->drupalPost('admin/content/aggregator/edit/feed/' . $feed->fid, $edit, t('Save'));
$this->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title'])), t('The feed %name has been updated.', array('%name' => $edit['title'])));
// Check feed data. // Check feed source.
$this->assertEqual($this->getUrl(), url('admin/content/aggregator/', array('absolute' => TRUE))); $this->drupalGet('aggregator/sources/' . $feed->fid);
$this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), t('The feed is unique.')); $this->assertResponse(200, t('Feed source exists.'));
$this->assertText($edit['title'], t('Page title'));
// Check feed source. // Delete feed.
$this->drupalGet('aggregator/sources/' . $feed->fid); $feed->title = $edit['title']; // Set correct title so deleteFeed() will work.
$this->assertResponse(200, t('Feed source exists.')); $this->deleteFeed($feed);
$this->assertText($edit['title'], t('Page title')); }
// Delete feed.
$feed->title = $edit['title']; // Set correct title so deleteFeed() will work.
$this->deleteFeed($feed);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment