You are here

class FeedsExamplesOPMLTestCase in Feeds 8.2

Same name and namespace in other branches
  1. 6 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase
  2. 7.2 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase
  3. 7 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase

Test OPML import configuration.

Hierarchy

Expanded class hierarchy of FeedsExamplesOPMLTestCase

File

feeds_news/feeds_news.test, line 92
Tests for feeds_news feature.

View source
class FeedsExamplesOPMLTestCase extends FeedsWebTestCase {
  public static function getInfo() {
    return array(
      'name' => 'Feature: OPML import',
      'description' => 'Test "OPML import" default configuration.',
      'group' => 'Feeds',
    );
  }

  /**
   * Enable feeds_news feature.
   */
  public function setUp() {
    parent::setUp(array(
      'feeds_news',
    ));
  }

  /**
   * Run tests.
   */
  public function test() {

    // Import OPML and assert.
    $file = $this
      ->generateOPML();
    $this
      ->importFile('opml', $file);
    $this
      ->assertText('Created 3 nodes');
    $count = db_query("SELECT COUNT(*) FROM {feeds_source}")
      ->fetchField();
    $this
      ->assertEqual($count, 4, 'Found correct number of items.');

    // Import a feed and then delete all items from it.
    $this
      ->drupalPost('node/1/import', array(), 'Import');
    $this
      ->assertText('Created 10 nodes');
    $this
      ->drupalPost('node/1/delete-items', array(), 'Delete');
    $this
      ->assertText('Deleted 10 nodes');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsExamplesOPMLTestCase::getInfo public static function
FeedsExamplesOPMLTestCase::setUp public function Enable feeds_news feature.
FeedsExamplesOPMLTestCase::test public function Run tests.