You are here

public function FeedsRSStoNodesTest::testOddFeedSchemes in Feeds 7.2

Same name and namespace in other branches
  1. 6 tests/feeds_processor_node.test \FeedsRSStoNodesTest::testOddFeedSchemes()

Test using non-normal URLs like feed:// and webcal://.

File

tests/feeds_processor_node.test, line 423
Tests for plugins/FeedsNodeProcessor.inc.

Class

FeedsRSStoNodesTest
Test aggregating a feed as node items.

Code

public function testOddFeedSchemes() {
  $url = $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'feeds') . '/tests/feeds/developmentseed.rss2';
  $schemes = array(
    'feed',
    'webcal',
  );
  $item_count = 0;
  foreach ($schemes as $scheme) {
    $feed_url = strtr($url, array(
      'http://' => $scheme . '://',
      'https://' => $scheme . '://',
    ));
    $edit['feeds[FeedsHTTPFetcher][source]'] = $feed_url;
    $this
      ->drupalPost('node/add/page', $edit, 'Save');
    $this
      ->assertText('Basic page Development Seed - Technological Solutions for Progressive Organizations has been created.');
    $this
      ->assertText('Created 10 nodes.');
    $this
      ->assertFeedItemCount($item_count + 10);
    $item_count += 10;
  }
}