public function FeedsWebTestCase::setPlugin in Feeds 7.2
Same name and namespace in other branches
- 6 tests/feeds.test \FeedsWebTestCase::setPlugin()
- 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()).
70 calls to FeedsWebTestCase::setPlugin()
- FeedsAccountSwitcherTest::testAuthorizedImport in tests/
FeedsAccountSwitcherTest.test - Tests if an extra account switch happens on authorized imports.
- FeedsAccountSwitcherTest::testRunImportAsFeedNodeAuthorInUI in tests/
FeedsAccountSwitcherTest.test - Tests if the import is ran as the feed node author when using the UI.
- FeedsAccountSwitcherTest::testRunImportAsFeedNodeAuthorOnCron in tests/
FeedsAccountSwitcherTest.test - Tests if the import is ran as the feed node author when using cron.
- FeedsContentTypeTest::testRequiredNodeTitleWithCSVParser in tests/
feeds_content_type.test - Tests if the node title is required when the CSV parser is used.
- FeedsCSVParserTestCase::testEncodingFailure in tests/
feeds_parser_csv.test - Tests an encoding failure during parsing a CSV.
File
- tests/
feeds.test, line 219 - 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/{$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 . ').');
}
}