public function FeedsFileFetcherTestCase::testPrivateFiles in Feeds 7.2
Test uploading private files.
File
- tests/
feeds_fetcher_file.test, line 85 - File fetcher tests.
Class
- FeedsFileFetcherTestCase
- File fetcher test class.
Code
public function testPrivateFiles() {
// Straight up upload is covered in other tests, focus on direct mode and
// file batching here.
$settings = array(
'direct' => TRUE,
'directory' => 'private://feeds',
);
$this
->setSettings('node', 'FeedsFileFetcher', $settings);
// Verify batching through directories.
// Copy directory of files.
$dir = 'private://batchtest';
$this
->copyDir($this
->absolutePath() . '/tests/feeds/batch', $dir);
// Ingest directory of files. Set limit to 5 to force processor to batch,
// too.
variable_set('feeds_process_limit', 5);
$edit = array(
'feeds[FeedsFileFetcher][source]' => $dir,
);
$this
->drupalPost('import/node', $edit, t('Import'));
$this
->assertText('Created 18 nodes');
}