You are here

function FeedsMapperOGTestCase::setUp in Feeds 7

Same name and namespace in other branches
  1. 6 tests/feeds_mapper_og.test \FeedsMapperOGTestCase::setUp()

Set up the test.

Overrides DrupalWebTestCase::setUp

File

tests/feeds_mapper_og.test, line 26

Class

FeedsMapperOGTestCase
Class for testing Feeds <em>locale</em> mapper.

Code

function setUp() {

  // Call parent setup with required modules.
  parent::setUp('feeds', 'feeds_ui', 'ctools', 'job_scheduler', 'og');

  // Create user and login.
  $this
    ->drupalLogin($this
    ->drupalCreateUser(array(
    'administer content types',
    'administer feeds',
    'administer nodes',
    'administer site configuration',
    'administer organic groups',
  )));

  // Add and configure a group content type, configure article, page type.
  $edit = array(
    'name' => 'Group',
    'type' => 'group',
    'og_content_type_usage' => 'group',
  );
  $this
    ->drupalPost('admin/content/types/add', $edit, t('Save content type'));
  $edit = array(
    'og_content_type_usage' => 'group_post_standard',
  );
  foreach (array(
    'article',
    'page',
  ) as $type) {
    $this
      ->drupalPost("admin/content/node-type/{$type}", $edit, t('Save content type'));
  }

  // Create an importer configuration with basic mapping.
  $this
    ->createImporterConfiguration('Syndication', 'syndication');
  $this
    ->addMappings('syndication', array(
    array(
      'source' => 'title',
      'target' => 'title',
      'unique' => FALSE,
    ),
    array(
      'source' => 'description',
      'target' => 'body',
      'unique' => FALSE,
    ),
    array(
      'source' => 'timestamp',
      'target' => 'created',
      'unique' => FALSE,
    ),
    array(
      'source' => 'url',
      'target' => 'url',
      'unique' => TRUE,
    ),
    array(
      'source' => 'guid',
      'target' => 'guid',
      'unique' => TRUE,
    ),
  ));
}