function AggregatorTestCase::getFeedEditArray

Returns a randomly generated feed edit array.

Parameters

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

Return value

A feed array.

4 calls to AggregatorTestCase::getFeedEditArray()
AggregatorTestCase::createFeed in drupal/modules/aggregator/aggregator.test
Creates an aggregator feed.
CategorizeFeedTestCase::testCategorizeFeed in drupal/modules/aggregator/aggregator.test
Creates a feed and makes sure you can add/delete categories to it.
ImportOPMLTestCase::submitImportForm in drupal/modules/aggregator/aggregator.test
Submits form with invalid, empty, and valid OPML files.
UpdateFeedTestCase::testUpdateFeed in drupal/modules/aggregator/aggregator.test
Creates a feed and attempts to update it.

File

drupal/modules/aggregator/aggregator.test, line 63
Tests for aggregator.module.

Class

AggregatorTestCase
Defines a base class for testing the Aggregator module.

Code

function getFeedEditArray($feed_url = NULL) {
  $feed_name = $this
    ->randomName(10);
  if (!$feed_url) {
    $feed_url = url('rss.xml', array(
      'query' => array(
        'feed' => $feed_name,
      ),
      'absolute' => TRUE,
    ));
  }
  $edit = array(
    'title' => $feed_name,
    'url' => $feed_url,
    'refresh' => '900',
  );
  return $edit;
}