Index: tests/feedapi_mapper_date.test =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/feedapi_mapper/tests/feedapi_mapper_date.test,v retrieving revision 1.2.2.1 diff -u -p -r1.2.2.1 feedapi_mapper_date.test --- tests/feedapi_mapper_date.test 7 Aug 2009 15:29:01 -0000 1.2.2.1 +++ tests/feedapi_mapper_date.test 19 Aug 2009 13:38:20 -0000 @@ -49,37 +49,44 @@ class FeedApiMapperDateTestCase extends function testDateMapping() { - $options = array( - 'fields' => array( - 'alpha' => 'date', - 'beta' => 'datestamp', - 'gamma' => 'datetime', - ), - 'filename' => 'drupal.xml', - // 'mappers' => array('node', 'date'), - 'mapping' => array( - serialize(array('title')) => serialize(array('node', 'title')), - serialize(array('description')) => serialize(array('node', 'body')), - serialize(array('options', 'timestamp')) => serialize(array('date', 'field_beta', 'start_stamp')), - // @todo: find source data with more dates - ), + $params = array(); + $params[] = array( + 'source' => serialize(array('options', 'raw', 'pubDate')), + 'target' => serialize(array('date', 'field_alpha', 'start_date')), + 'result' => 'Fri, 04/17/2009 - 15:21', + 'field' => array('alpha' => 'date'), ); + $params[] = array( + 'source' => serialize(array('options', 'timestamp')), + 'target' => serialize(array('date', 'field_beta', 'start_stamp')), + 'result' => 'Fri, 04/17/2009 - 15:21', + 'field' => array('beta' => 'datestamp'), + ); + foreach ($params as $param) { + $options = array( + 'fields' => $param['field'], + 'filename' => 'drupal.xml', + 'mappers' => array('node', 'date'), + 'mapping' => array( + serialize(array('title')) => serialize(array('node', 'title')), + serialize(array('description')) => serialize(array('node', 'body')), + $param['source'] => $param['target'], + ), + ); - $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->drupalLogin($this->admin_user); + $this->enableParsers(TRUE, FALSE); + $feed_url = $this->setupFeed($options); - // $this->assertText('http://drupal.org/node/431830#comments', 'Found comments text'); - // $this->assertText('1239981668', 'Found timestamp integer'); + // 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($param['result']); + $this->assertText('The videos of more than 100 presentations'); - $this->deleteFeed($feed_url); - $this->drupalLogout(); + $this->deleteFeed($feed_url); + $this->drupalLogout(); + } } } Index: tests/feedapi_mapper_test.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/feedapi_mapper/tests/feedapi_mapper_test.inc,v retrieving revision 1.2.2.1 diff -u -p -r1.2.2.1 feedapi_mapper_test.inc --- tests/feedapi_mapper_test.inc 16 Jul 2009 14:19:12 -0000 1.2.2.1 +++ tests/feedapi_mapper_test.inc 19 Aug 2009 13:38:20 -0000 @@ -132,6 +132,9 @@ class FeedApiMapperTestCase extends Drup $this->assertText('This action cannot be undone.'); $this->drupalPost(NULL, array(), 'Delete'); $this->assertText('has been deleted.'); + + // Delete the per-content-type mapping + db_query("DELETE FROM {feedapi_mapper}"); } /**