drupalLogin( $this->drupalCreateUser( array( 'administer feeds', 'administer nodes', 'administer data tables', ) ) ); } /** * Describe this test. */ public function getInfo() { return array( 'name' => t('Feature: Fast feed'), 'description' => t('Test "Fast feed" default configuration Requires Data, Features and Views.'), 'group' => t('Feeds'), ); } /** * Run tests. */ 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.'); } }