function FeedAPUploadTestsCase::testFileUploadAbility in FeedAPI 6
Test the file upload form
File
- tests/
feedapi_upload.test, line 24
Class
- FeedAPUploadTestsCase
- Class for testing FeedAPI file upload support.
Code
function testFileUploadAbility() {
$this
->create_type(array_pop($this
->get_parsers()), TRUE);
$settings = feedapi_get_settings($this->info->type);
$this
->feedapi_user();
$edit = array(
'files[feedapi]' => drupal_get_path('module', 'feedapi') . '/tests/files/feed',
);
$this
->drupalPost('node/add/' . $this->info->type, $edit, 'Save');
$this
->assertText('drupal.org', 'The feed title is on the saved node.');
$status = db_result(db_query('SELECT status FROM {files}'));
$this
->assertEqual($status, FILE_STATUS_PERMANENT, 'The uploaded file is permanent');
}