You are here

public function FeedsWebTestCase::setPlugin in Feeds 7

Same name and namespace in other branches
  1. 6 tests/feeds.test \FeedsWebTestCase::setPlugin()
  2. 7.2 tests/feeds.test \FeedsWebTestCase::setPlugin()

Choose a plugin for a importer configuration and assert it.

Parameters

$id: The importer configuration's id.

$plugin_key: The key string of the plugin to choose (one of the keys defined in feeds_feeds_plugins()).

10 calls to FeedsWebTestCase::setPlugin()
FeedsCSVtoTermsTest::test in tests/feeds_processor_term.test
Test node creation, refreshing/deleting feeds and feed items.
FeedsCSVtoUsersTest::test in tests/feeds_processor_user.test
Test node creation, refreshing/deleting feeds and feed items.
FeedsMapperContentTestCase::test in tests/feeds_mapper_content.test
Basic test loading a doulbe entry CSV file.
FeedsMapperDateTestCase::test in tests/feeds_mapper_date.test
Basic test loading a single entry CSV file.
FeedsMapperEmfieldTestCase::test in tests/feeds_mapper_emfield.test
Basic test loading a doulbe entry CSV file.

... See full list

File

tests/feeds.test.inc, line 115
Common functionality for all Feeds tests.

Class

FeedsWebTestCase
Test basic Data API functionality.

Code

public function setPlugin($id, $plugin_key) {
  if ($type = FeedsPlugin::typeOf($plugin_key)) {
    $edit = array(
      'plugin_key' => $plugin_key,
    );
    $this
      ->drupalPost("admin/structure/feeds/edit/{$id}/{$type}", $edit, 'Save');

    // Assert actual configuration.
    $config = unserialize(db_query("SELECT config FROM {feeds_importer} WHERE id = :id", array(
      ':id' => $id,
    ))
      ->fetchField());
    $this
      ->assertEqual($config[$type]['plugin_key'], $plugin_key, 'Verified correct ' . $type . ' (' . $plugin_key . ').');
  }
}