function AggregatorTestBase::getFeedEditObject

Returns a randomly generated feed edit object.

Parameters

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

array $values: (optional) Default values to initialize object properties with.

Return value

\Drupal\aggregator\Plugin\Core\Entity\Feed A feed object.

1 call to AggregatorTestBase::getFeedEditObject()
CategorizeFeedTest::testCategorizeFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php
Creates a feed and makes sure you can add more than one category to it.

File

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

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

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