5 * Tests for feeds_fast_news feature.
8 // Require FeedsWebTestCase class definition.
9 require_once(dirname(__FILE__
) .
'/../tests/feeds.test.inc');
12 * Test Feed fast configuration.
14 class FeedsExamplesFastFeedTestCase
extends FeedsWebTestCase
{
19 public
function setUp() {
20 parent
::setUp('feeds', 'feeds_ui', 'ctools', 'job_scheduler', 'features', 'feeds_fast_news', 'data', 'data_ui', 'views', 'views_ui');
23 $this->drupalCreateUser(
25 'administer feeds', 'administer nodes', 'administer data tables',
34 public
function getInfo() {
36 'name' => t('Feature: Fast feed'),
37 'description' => t('Test "Fast feed" default configuration <strong>Requires Data, Features and Views.</strong>'),
38 'group' => t('Feeds'),
45 public
function test() {
47 // Enable configuration and assert status.
48 $this->drupalGet('admin/build/data');
49 $this->assertText('feeds_data_feed_fast');
50 $this->drupalGet('admin/content/data/view/feeds_data_feed_fast');
51 $this->assertText('Fast feed');
52 $this->assertText('There is no data in this table.');
55 $nid = $this->createFeedNode('feed_fast', NULL
, '', 'feed_fast');
56 $this->assertText('Created 10 items.');
58 // Verify presence of aggregated items.
59 $this->drupalGet('admin/content/data/view/feeds_data_feed_fast');
60 $this->assertText('Open Atrium Translation Workflow: Two Way Translation Updates');
61 $this->assertText('n a word, nothing. There has been a major improvement on this front. Now your translation');
62 $this->assertLink('http://developmentseed.org/blog/2009/oct/06/open-atrium-translation-workflow-two-way-updating');
64 // Delete and re import.
65 $this->drupalPost('node/'.
$nid .
'/delete-items', array(), 'Delete');
66 $this->assertText('All items have been deleted.');
67 $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_data_feed_fast}"));
68 $this->assertEqual($count, 0, 'Found correct number of items.');
70 $this->drupalPost('node/'.
$nid .
'/delete-items', array(), 'Delete');
71 $this->assertText('There were no items to delete.');
72 $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_data_feed_fast}"));
73 $this->assertEqual($count, 0, 'Found correct number of items.');
75 $this->drupalPost('node/'.
$nid .
'/import', array(), 'Import');
76 $this->assertText('Created 10 items.');
77 $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_data_feed_fast}"));
78 $this->assertEqual($count, 10, 'Found correct number of items.');
80 $this->drupalPost('node/'.
$nid .
'/import', array(), 'Import');
81 $this->assertText('There are no new items.');
82 $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_data_feed_fast}"));
83 $this->assertEqual($count, 10, 'Found correct number of items.');