t('FeedAPI Mapper'), 'description' => t('Test basic FeedAPI Mapper function'), 'group' => t('FeedAPI Mapper'), ); } /** * SimpleTest core method: code run before each and every test method. */ function setUp() { // Always call the setUp() function from the parent class. @parent::setUp( 'feedapi', 'feedapi_node', 'parser_common_syndication', 'parser_simplepie', 'feedapi_mapper' ); // Create users. $this->admin_user = $this->drupalCreateUser( array( 'administer content types', 'administer feedapi', 'administer nodes', 'administer site configuration', 'advanced feedapi options', 'create feed content', ) ); } function testCommonSyndicationParserMapping() { $this->drupalLogin($this->admin_user); $this->enableParsers(FALSE, TRUE); $this->_testDefaultMapping(); $this->drupalLogout(); } function testSimplePieParserMapping() { $this->drupalLogin($this->admin_user); $this->enableParsers(TRUE, FALSE); $this->_testDefaultMapping(); $this->drupalLogout(); } function _testDefaultMapping() { $options = array( 'typename' => 'story', 'filename' => 'drupal.xml', 'mappers' => array('node'), 'mapping' => array( ), ); $feed_url = $this->setupFeed($options); // Check one of the nodes $this->drupalGet('admin/content/node/overview'); $this->clickLink('DrupalCon DC Website: A Conference Archive'); $this->assertRaw('

DrupalCon DC Website: A Conference Archive

'); $this->assertText('Fri, 04/17/2009 - 15:21'); $this->assertText('The videos of more than 100 presentations'); // @todo: check lots of edge cases, wierd formats etc // @todo: check multi-value fields // @todo: check what happens if multiple fields elements map to the same field $this->deleteFeed($feed_url); } }