function AggregatorTestCase::createFeed

Creates an aggregator feed.

This method simulates the form submission on path admin/config/services/aggregator/add/feed.

Parameters

$feed_url: (optional) If given, feed will be created with this URL, otherwise /rss.xml will be used. Defaults to NULL.

Return value

$feed Full feed object if possible.

See also

getFeedEditArray()

14 calls to AggregatorTestCase::createFeed()
AddFeedTestCase::testAddFeed in modules/aggregator/aggregator.test
Creates and ensures that a feed is unique, checks source, and deletes feed.
AddFeedTestCase::testAddLongFeed in modules/aggregator/aggregator.test
Tests feeds with very long URLs.
AggregatorCronTestCase::testCron in modules/aggregator/aggregator.test
Adds feeds and updates them via cron process.
AggregatorRenderingTestCase::testBlockLinks in modules/aggregator/aggregator.test
Adds a feed block to the page and checks its links.
AggregatorRenderingTestCase::testFeedPage in modules/aggregator/aggregator.test
Creates a feed and checks that feed's page.

... See full list

File

modules/aggregator/aggregator.test, line 33

Class

AggregatorTestCase
Defines a base class for testing the Aggregator module.

Code

function createFeed($feed_url = NULL) {
    $edit = $this->getFeedEditArray($feed_url);
    $this->drupalPost('admin/config/services/aggregator/add/feed', $edit, t('Save'));
    $this->assertRaw(t('The feed %name has been added.', array(
        '%name' => $edit['title'],
    )), format_string('The feed !name has been added.', array(
        '!name' => $edit['title'],
    )));
    $feed = db_query("SELECT *  FROM {aggregator_feed} WHERE title = :title AND url = :url", array(
        ':title' => $edit['title'],
        ':url' => $edit['url'],
    ))->fetch();
    $this->assertTrue(!empty($feed), 'The feed found in database.');
    return $feed;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.