You are here

public function FeedsOgTest::setUp in Feeds 7.2

Set up test.

Overrides FeedsWebTestCase::setUp

File

tests/feeds_og.test, line 28
Contains FeedsOgTest.

Class

FeedsOgTest
Tests for Organic Groups integration.

Code

public function setUp() {
  parent::setUp(array(
    'og',
  ));

  // Add OG group field to the node type 'page'.
  og_create_field(OG_GROUP_FIELD, 'node', 'page');

  // Add OG audience field to the node's "article" bundle.
  $og_field = og_fields_info(OG_AUDIENCE_FIELD);
  $og_field['field']['settings']['target_type'] = 'node';
  og_create_field(OG_AUDIENCE_FIELD, 'node', 'article', $og_field);

  // Do not use curl as that will result into HTTP requests returning a 404.
  variable_set('feeds_never_use_curl', TRUE);

  // Create an importer. Do not import on create.
  $this
    ->createImporterConfiguration('Syndication', 'syndication');
  $this
    ->setSettings('syndication', NULL, array(
    'import_period' => FEEDS_SCHEDULE_NEVER,
    'import_on_create' => FALSE,
  ));
  $this
    ->setPlugin('syndication', 'FeedsCSVParser');
  $this
    ->addMappings('syndication', array(
    0 => array(
      'source' => 'title',
      'target' => 'title',
    ),
  ));

  // Clear cache to make permission 'create article content' available.
  drupal_static_reset();
  drupal_flush_all_caches();
}