public function FeedsTamperEfqFinderTestCase::setUp in Feeds Tamper 7
Overrides FeedsTamperWebTestHelper::setUp
File
- tests/
feeds_tamper_efq_finder.test, line 21 - Contains FeedsTamperEfqFinderTestCase.
Class
- FeedsTamperEfqFinderTestCase
- Tests for the efq_finder plugin.
Code
public function setUp() {
parent::setUp(array(
'feeds_tamper_ui',
), array(
'administer feeds_tamper',
));
// Create vocabulary.
$edit = array(
'name' => 'Ref terms',
'machine_name' => 'terms',
);
$this
->drupalPost('admin/structure/taxonomy/add', $edit, t('Save'));
// // Add a taxonomy term field.
$edit = array(
'fields[_add_new_field][label]' => 'Term',
'fields[_add_new_field][field_name]' => 'term',
'fields[_add_new_field][type]' => 'taxonomy_term_reference',
'fields[_add_new_field][widget_type]' => 'options_select',
);
$this
->drupalPost('admin/structure/types/manage/article/fields', $edit, t('Save'));
$edit = array(
'field[settings][allowed_values][0][vocabulary]' => 'terms',
);
$this
->drupalPost(NULL, $edit, t('Save field settings'));
$this
->createImporterConfiguration();
$this
->setSettings('syndication', NULL, array(
'content_type' => '',
));
$this
->setPlugin('syndication', 'FeedsFileFetcher');
$this
->setPlugin('syndication', 'FeedsCSVParser');
$this
->addMappings('syndication', array(
0 => array(
'source' => 'title',
'target' => 'title',
'unique' => FALSE,
),
1 => array(
'source' => 'ref',
'target' => 'field_term',
'term_search' => 1,
),
));
}