You are here

public function FeedsTamperTemporaryTargetTestCase::testAddTemporaryTargets in Feeds Tamper 7

Tests adding temporary targets.

File

tests/temporary_target.test, line 19

Class

FeedsTamperTemporaryTargetTestCase
Tests blank sources and temporary targets.

Code

public function testAddTemporaryTargets() {
  $importer_name = $this
    ->randomName();
  $importer_id = drupal_strtolower($importer_name);

  // Set up an importer.
  $this
    ->createImporterConfiguration($importer_name, $importer_id);

  // Add three temporary targets.
  $this
    ->addMappings($importer_id, array(
    0 => array(
      'source' => 'title',
      'target' => 'Temporary target 1',
    ),
    1 => array(
      'source' => 'guid',
      'target' => 'Temporary target 2',
    ),
    2 => array(
      'source' => 'description',
      'target' => 'Temporary target 3',
    ),
  ));

  // Assert that all targets are displayed in the UI.
  $this
    ->assertText('Temporary target 1');
  $this
    ->assertText('Temporary target 2');
  $this
    ->assertText('Temporary target 3');
}