t('FeedAPI Mapper Content'), 'description' => t('Test FeedAPI Mapper support for CCK fields'), '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_simplepie', 'parser_common_syndication', 'feedapi_mapper', 'content', 'number', 'text', 'ctools' ); // 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 testContentMapping() { $options = array( 'fields' => array( 'alpha' => 'text', 'beta' => 'number_integer', 'gamma' => 'number_decimal', ), 'filename' => 'drupal.xml', 'mappers' => array('node', 'content'), 'mapping' => array( serialize(array('options', 'raw' ,'comments')) => serialize(array('content', 'field_alpha')), serialize(array('options', 'timestamp')) => serialize(array('content', 'field_beta')), // @todo: use a field that contains a decimal ), ); $this->drupalLogin($this->admin_user); $this->enableParsers(TRUE, FALSE); $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'); $this->assertText('http://drupal.org/node/431830#comments', 'Found comments text'); $this->assertText('1239981668', 'Found timestamp integer'); $this->deleteFeed($feed_url); $this->drupalLogout(); } }