You are here

public function FeedsWebTestCase::importFile in Feeds 7.2

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

Import a file through the import form. Assumes FeedsFileFetcher in place.

Parameters

string $id: The ID of the importer.

string $file: The absolute path to the file.

string $submit: (optional) The button to press. Defaults to the button "Import".

86 calls to FeedsWebTestCase::importFile()
FeedsCSVParserTestCase::testEncodingFailure in tests/feeds_parser_csv.test
Tests an encoding failure during parsing a CSV.
FeedsCSVParserTestCase::testMbstringExtensionDisabled in tests/feeds_parser_csv.test
Tests parsing a CSV when the mbstring extension is not available.
FeedsCSVtoTermsTest::test in tests/feeds_processor_term.test
Test term creation, refreshing/deleting feeds and feed items.
FeedsCSVtoTermsTest::testInvalidVocabulary in tests/feeds_processor_term.test
Test that saving an invalid vocabulary throws an exception.
FeedsCSVtoTermsTest::testParentTargetByGUID in tests/feeds_processor_term.test
Tests that terms mapped to their parent by GUID are from the same vocabulary.

... See full list

File

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

Class

FeedsWebTestCase
Test basic Data API functionality.

Code

public function importFile($id, $file, $submit = NULL) {
  $this
    ->assertTrue(file_exists($file), 'Source file exists');
  $edit = array(
    'files[feeds]' => $file,
  );
  if (empty($submit)) {
    $submit = 'Import';
  }
  $this
    ->drupalPost('import/' . $id, $edit, $submit);
}