You are here

function FeedAPI_Node_Tests::create_type in FeedAPI 5

Create a new content-type for creating the feed node

1 call to FeedAPI_Node_Tests::create_type()
FeedAPI_Node_Tests::testFeedAPI_Node_Refresh_Feed in feedapi_node/tests/feedapi_node.module.test
Add a content-type, create a feed and refresh it. Check if everything seems ok Delete the feed Check if the rubbish is purged as well.

File

feedapi_node/tests/feedapi_node.module.test, line 26

Class

FeedAPI_Node_Tests
Class for testing feedapi_node. It also tests FeedAPI and SimplePie parsers.

Code

function create_type() {
  $this->info->type = 'feedapi_node_' . $this
    ->randomName();
  $this->info->name = 'Feed' . str_replace('_', ' ', $this
    ->randomName());
  $this->info->description = t('Aggregates RSS or Atom feeds. Items from these feeds will be turned into nodes.');
  $this->info->module = 'node';
  $this->info->has_title = TRUE;
  $this->info->title_label = t('Title');
  $this->info->has_body = TRUE;
  $this->info->body_label = t('Body');
  $this->info->min_word_count = 0;
  $this->info->custom = TRUE;
  node_type_save($this->info);

  // Adding default FeedAPI settings
  variable_set('feedapi_settings_' . $this->info->type, unserialize('a:3:{s:7:"enabled";s:1:"1";s:7:"parsers";a:2:{s:16:"parser_simplepie";a:3:{s:7:"enabled";s:1:"1";s:6:"weight";s:1:"0";s:4:"test";s:1:"3";}s:25:"parser_common_syndication";a:3:{s:7:"enabled";s:1:"0";s:6:"weight";s:2:"-2";s:6:"tester";s:1:"3";}}s:10:"processors";a:2:{s:12:"feedapi_node";a:5:{s:6:"weight";s:1:"0";s:12:"content_type";s:5:"story";s:9:"node_date";s:4:"feed";s:7:"promote";s:1:"3";s:7:"enabled";s:1:"1";}s:18:"feedapi_aggregator";a:2:{s:6:"weight";s:1:"0";s:5:"block";s:1:"3";}}}'));
}