You are here

public function FeedsFileHTTPTestCase::setUpImporter in Feeds 7.2

Setup importer to import items from testing/feeds/nodes.csv.

7 calls to FeedsFileHTTPTestCase::setUpImporter()
FeedsFileHTTPTestCase::setUpMultipleCronRuns in tests/feeds_fetcher_http.test
Configures the evironment so that multiple cron runs are needed to complete an import.
FeedsFileHTTPTestCase::testCachedFilesCleanupOnHTTPCacheOverride in tests/feeds_fetcher_http.test
Tests if cached files are cleaned up even when a different cache class is used.
FeedsFileHTTPTestCase::testChangedSource in tests/feeds_fetcher_http.test
Tests if the source is refetched on a second import when the source changed.
FeedsFileHTTPTestCase::testHTTPCacheDisabled in tests/feeds_fetcher_http.test
Tests if the data is not cached when the option for caching is disabled.
FeedsFileHTTPTestCase::testHTTPCacheOverride in tests/feeds_fetcher_http.test
Tests if the data is cached on the file system even when a different cache class is used.

... See full list

File

tests/feeds_fetcher_http.test, line 40
Contains FeedsFileHTTPTestCase.

Class

FeedsFileHTTPTestCase
HTTP fetcher test class.

Code

public function setUpImporter() {

  // Set up an importer.
  $this
    ->createImporterConfiguration('Node import', 'node');
  $this
    ->setSettings('node', NULL, array(
    'content_type' => '',
    'import_period' => 0,
  ));
  $this
    ->setPlugin('node', 'FeedsHTTPFetcher');
  $this
    ->setPlugin('node', 'FeedsCSVParser');
  $this
    ->setSettings('node', 'FeedsNodeProcessor', array(
    'update_existing' => FEEDS_UPDATE_EXISTING,
  ));
  $this
    ->addMappings('node', array(
    0 => array(
      'source' => 'title',
      'target' => 'title',
      'unique' => TRUE,
    ),
    1 => array(
      'source' => 'body',
      'target' => 'body',
    ),
  ));
}