You are here

public function FeedsExamplesFastFeedTestCase::test in Feeds 7

Same name and namespace in other branches
  1. 6 feeds_fast_news/feeds_fast_news.test \FeedsExamplesFastFeedTestCase::test()

Run tests.

File

feeds_fast_news/feeds_fast_news.test, line 45
Tests for feeds_fast_news feature.

Class

FeedsExamplesFastFeedTestCase
Test Feed fast configuration.

Code

public function test() {

  // Enable configuration and assert status.
  $this
    ->drupalGet('admin/build/data');
  $this
    ->assertText('feeds_data_feed_fast');
  $this
    ->drupalGet('admin/content/data/view/feeds_data_feed_fast');
  $this
    ->assertText('Fast feed');
  $this
    ->assertText('There is no data in this table.');

  // Create feed node.
  $nid = $this
    ->createFeedNode('feed_fast', NULL, '', 'feed_fast');
  $this
    ->assertText('Created 10 items.');

  // Verify presence of aggregated items.
  $this
    ->drupalGet('admin/content/data/view/feeds_data_feed_fast');
  $this
    ->assertText('Open Atrium Translation Workflow: Two Way Translation Updates');
  $this
    ->assertText('n a word, nothing. There has been a major improvement on this front. Now your translation');
  $this
    ->assertLink('http://developmentseed.org/blog/2009/oct/06/open-atrium-translation-workflow-two-way-updating');

  // Delete and re import.
  $this
    ->drupalPost('node/' . $nid . '/delete-items', array(), 'Delete');
  $this
    ->assertText('All items have been deleted.');
  $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_data_feed_fast}"));
  $this
    ->assertEqual($count, 0, 'Found correct number of items.');
  $this
    ->drupalPost('node/' . $nid . '/delete-items', array(), 'Delete');
  $this
    ->assertText('There were no items to delete.');
  $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_data_feed_fast}"));
  $this
    ->assertEqual($count, 0, 'Found correct number of items.');
  $this
    ->drupalPost('node/' . $nid . '/import', array(), 'Import');
  $this
    ->assertText('Created 10 items.');
  $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_data_feed_fast}"));
  $this
    ->assertEqual($count, 10, 'Found correct number of items.');
  $this
    ->drupalPost('node/' . $nid . '/import', array(), 'Import');
  $this
    ->assertText('There are no new items.');
  $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_data_feed_fast}"));
  $this
    ->assertEqual($count, 10, 'Found correct number of items.');
}