temporary_target.test in Feeds Tamper 7
File
tests/temporary_target.test
View source
<?php
class FeedsTamperTemporaryTargetTestCase extends FeedsTamperWebTestHelper {
public static function getInfo() {
return array(
'name' => 'Temporary targets and blank sources',
'description' => 'Tests for adding temporary targets and blank sources.',
'group' => 'Feeds Tamper',
);
}
public function testAddTemporaryTargets() {
$importer_name = $this
->randomName();
$importer_id = drupal_strtolower($importer_name);
$this
->createImporterConfiguration($importer_name, $importer_id);
$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',
),
));
$this
->assertText('Temporary target 1');
$this
->assertText('Temporary target 2');
$this
->assertText('Temporary target 3');
}
public function testAddBlankSources() {
$importer_name = $this
->randomName();
$importer_id = drupal_strtolower($importer_name);
$this
->createImporterConfiguration($importer_name, $importer_id);
$this
->addMappings($importer_id, array(
0 => array(
'source' => 'Blank source 1',
'target' => 'title',
),
1 => array(
'source' => 'Blank source 2',
'target' => 'guid',
),
2 => array(
'source' => 'Blank source 3',
'target' => 'body',
),
));
$this
->assertText('Blank source 1');
$this
->assertText('Blank source 2');
$this
->assertText('Blank source 3');
}
}