function AggregatorTestBase::getFeedEditArray

Return a randomly generated feed edit array.

Parameters

$feed_url: If given, feed will be created with this URL, otherwise /rss.xml will be used.

Return value

A feed array.

4 calls to AggregatorTestBase::getFeedEditArray()
AggregatorTestBase::createFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
Create an aggregator feed (simulate form submission on admin/config/services/aggregator/add/feed).
CategorizeFeedTest::testCategorizeFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php
Create a feed and make sure you can add more than one category to it.
ImportOpmlTest::submitImportForm in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php
Submit form with invalid, empty and valid OPML files.
UpdateFeedTest::testUpdateFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php
Create a feed and attempt to update it.

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php, line 75
Definition of Drupal\aggregator\Tests\AggregatorTestBase.

Class

AggregatorTestBase
Defines a base class for testing aggregator.module.

Namespace

Drupal\aggregator\Tests

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;
}