You are here

public function FeedsWebTestBase::setPlugin in Feeds 8.2

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()).

14 calls to FeedsWebTestBase::setPlugin()
FeedsCSVtoUsersTest::test in lib/Drupal/feeds/Tests/FeedsCSVtoUsersTest.php
Test node creation, refreshing/deleting feeds and feed items.
FeedsFileFetcherTest::testPrivateFiles in lib/Drupal/feeds/Tests/FeedsFileFetcherTest.php
Test uploading private files.
FeedsFileFetcherTest::testPublicFiles in lib/Drupal/feeds/Tests/FeedsFileFetcherTest.php
Test scheduling on cron.
FeedsMapperDateMultipleTest::test in lib/Drupal/feeds/Tests/FeedsMapperDateMultipleTest.php
Testing import by loading a 4 item XML file.
FeedsMapperDateTest::test in lib/Drupal/feeds/Tests/FeedsMapperDateTest.php
Basic test loading a single entry CSV file.

... See full list

File

lib/Drupal/feeds/Tests/FeedsWebTestBase.php, line 204
Common functionality for all Feeds tests.

Class

FeedsWebTestBase
Test basic Data API functionality.

Namespace

Drupal\feeds\Tests

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 = config('feeds.importer.' . $id)
      ->get('config');
    $this
      ->assertEqual($config[$type]['plugin_key'], $plugin_key, 'Verified correct ' . $type . ' (' . $plugin_key . ').');
  }
}