t('FeedAPI Mapper Link'), 'description' => t('Test FeedAPI Mapper support for Link 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', 'link', '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 testLinkMapping() { $options = array( 'fields' => array( 'alpha' => 'link', 'beta' => 'link', 'gamma' => 'link', ), 'filename' => 'php.atom', 'mappers' => array('node', 'link'), 'mapping' => array( serialize(array('options', 'guid')) => serialize(array('link', 'field_alpha')), serialize(array('options', 'original_author', 'link')) => serialize(array('link', 'field_beta')), serialize(array('options', 'raw', 'id')) => serialize(array('link', 'field_gamma')), ), ); $this->drupalLogin($this->admin_user); $this->enableParsers(TRUE, FALSE); $feed_url = $this->setupFeed($options); // The previous method actually causes an error right now, because refreshing // the feed emits "1 new item(s) were saved. 1 existing item(s) were updated." // rather than 2/0. See http://drupal.org/node/451926 // Check one of the nodes $this->drupalGet('admin/content/node/overview'); $this->clickLink('PHP 5.2.9 released!'); $this->assertLink('http://php.net/releases/5_2_9.php'); $this->assertLink('http://php.net/contact'); $this->assertLink('http://php.net/releases/5_2_9.php', 1); $this->drupalGet('admin/content/node/overview'); $this->clickLink('PHP 5.3.0RC1 released!'); $this->assertLink('http://php.net/releases.php#5.3.0RC1'); $this->assertLink('http://php.net/contact'); $this->assertLink('http://php.net/releases.php#5.3.0RC1', 1); $this->deleteFeed($feed_url); $this->drupalLogout(); } }