You are here

public function FeedsWebTestCase::setPlugin in Feeds 6

Same name and namespace in other branches
  1. 7.2 tests/feeds.test \FeedsWebTestCase::setPlugin()
  2. 7 tests/feeds.test.inc \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()).

13 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.
FeedsMapperContentTaxonomyTestCase::test in tests/feeds_mapper_content_taxonomy.test
Basic test loading a single entry CSV file.
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.

... See full list

File

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

Class

FeedsWebTestCase
Test basic Data API functionality.

Code

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

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