You are here

public function FeedsRSStoNodesTest::setUp in Feeds 8.2

Set up test.

Overrides FeedsWebTestBase::setUp

File

lib/Drupal/feeds/Tests/FeedsRSStoNodesTest.php, line 28
Tests for plugins/FeedsNodeProcessor.inc.

Class

FeedsRSStoNodesTest
Test aggregating a feed as node items.

Namespace

Drupal\feeds\Tests

Code

public function setUp() {
  parent::setUp();

  // Set the front page to show 20 nodes so we can easily see what is aggregated.
  variable_set('default_nodes_main', 20);

  // Set the teaser length display to unlimited otherwise tests looking for
  // text on nodes will fail.
  $edit = array(
    'fields[body][type]' => 'text_default',
  );
  $this
    ->drupalPost('admin/structure/types/manage/article/display/teaser', $edit, 'Save');

  // Create an importer configuration.
  FeedsConfigurable::$instances = array();
  $this
    ->createImporterConfiguration('Syndication', 'syndication');
  $this
    ->addMappings('syndication', array(
    0 => array(
      'source' => 'title',
      'target' => 'title',
      'unique' => FALSE,
    ),
    1 => array(
      'source' => 'description',
      'target' => 'body',
    ),
    2 => array(
      'source' => 'timestamp',
      'target' => 'created',
    ),
    3 => array(
      'source' => 'url',
      'target' => 'url',
      'unique' => TRUE,
    ),
    4 => array(
      'source' => 'guid',
      'target' => 'guid',
      'unique' => TRUE,
    ),
  ));
}