public function FeedsFileHTTPTestCase::testNonWritableCacheDirectory in Feeds 7.2
Tests that a non-writable cache directory does not result into fatal errors.
File
- tests/
feeds_fetcher_http.test, line 509 - Contains FeedsFileHTTPTestCase.
Class
- FeedsFileHTTPTestCase
- HTTP fetcher test class.
Code
public function testNonWritableCacheDirectory() {
// Set the cache directory to a non-writable directory.
variable_set('feeds_http_file_cache_dir', 'file://non-writeable-dir/feeds');
$this
->setUpImporter();
$source_url = url('testing/feeds/nodes.csv', array(
'absolute' => TRUE,
));
$edit = array(
'feeds[FeedsHTTPFetcher][source]' => $source_url,
);
$this
->drupalPost('import/node', $edit, t('Import'));
// Assert that a message is being displayed and that we are back on the
// import form.
$this
->assertText("The feeds cache directory (file://non-writeable-dir/feeds) either cannot be created or is not writable. You can change the cache directory by setting the 'feeds_http_file_cache_dir' variable.");
$this
->assertFieldByName('feeds[FeedsHTTPFetcher][source]', $source_url);
}