You are here

public function AggregatorTestBase::getFeedEditArray in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/aggregator/src/Tests/AggregatorTestBase.php \Drupal\aggregator\Tests\AggregatorTestBase::getFeedEditArray()

Returns a randomly generated feed edit array.

Parameters

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

array $edit: Array with additional form fields.

Return value

array A feed array.

3 calls to AggregatorTestBase::getFeedEditArray()
AggregatorTestBase::createFeed in core/modules/aggregator/src/Tests/AggregatorTestBase.php
Creates an aggregator feed.
ImportOpmlTest::submitImportForm in core/modules/aggregator/src/Tests/ImportOpmlTest.php
Submits form with invalid, empty, and valid OPML files.
UpdateFeedTest::testUpdateFeed in core/modules/aggregator/src/Tests/UpdateFeedTest.php
Creates a feed and attempts to update it.

File

core/modules/aggregator/src/Tests/AggregatorTestBase.php, line 99
Contains \Drupal\aggregator\Tests\AggregatorTestBase.

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

public function getFeedEditArray($feed_url = NULL, array $edit = array()) {
  $feed_name = $this
    ->randomMachineName(10);
  if (!$feed_url) {
    $feed_url = \Drupal::url('view.frontpage.feed_1', array(), array(
      'query' => array(
        'feed' => $feed_name,
      ),
      'absolute' => TRUE,
    ));
  }
  $edit += array(
    'title[0][value]' => $feed_name,
    'url[0][value]' => $feed_url,
    'refresh' => '900',
  );
  return $edit;
}