class FeedAPUploadTestsCase in FeedAPI 6
Class for testing FeedAPI file upload support.
Hierarchy
- class \FeedAPUploadTestsCase extends \FeedAPITestCase
Expanded class hierarchy of FeedAPUploadTestsCase
File
- tests/
feedapi_upload.test, line 8
View source
class FeedAPUploadTestsCase extends FeedAPITestCase {
/**
* Implementation of getInfo().
*/
public static function getInfo() {
return array(
'name' => t('FeedAPI file upload support'),
'description' => t('Tests to use a file upload for a feed instead of an URL.'),
'group' => t('FeedAPI'),
);
}
/**
* Test the file upload form
*/
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');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedAPUploadTestsCase:: |
public static | function | Implementation of getInfo(). | |
FeedAPUploadTestsCase:: |
function | Test the file upload form |