You are here

protected function FeedsTamperEfqFinderTestCase::addEfqPlugin in Feeds Tamper 7

Creates an efq_finder plugin instance.

1 call to FeedsTamperEfqFinderTestCase::addEfqPlugin()
FeedsTamperEfqFinderTestCase::doTaxonomyTermTest in tests/feeds_tamper_efq_finder.test
Performs the verification.

File

tests/feeds_tamper_efq_finder.test, line 147
Contains FeedsTamperEfqFinderTestCase.

Class

FeedsTamperEfqFinderTestCase
Tests for the efq_finder plugin.

Code

protected function addEfqPlugin($importer, $source, array $settings) {
  $edit = array(
    'plugin_id' => 'efq_finder',
  );
  $this
    ->drupalPost('admin/structure/feeds/' . $importer . '/tamper/add/' . bin2hex($source), $edit, t('Choose'));
  foreach (array(
    'entity_type',
    'bundle',
    'field',
    'column',
  ) as $key) {
    if (!empty($settings[$key])) {
      $this
        ->drupalPost(NULL, array(
        "settings[{$key}]" => $settings[$key],
      ), t('Update'));
    }
  }
  $this
    ->drupalPost(NULL, array(), t('Add'));
  $this
    ->assertRaw(t('Plugin %name was successfully added to %source.', array(
    '%name' => 'Entity Field Query finder',
    '%source' => $source,
  )));
}