function FeedAPIErrorTestsCase::testFeedAPI_Invalid_URL in FeedAPI 6
File
- tests/
feedapi_error.test, line 22
Class
- FeedAPIErrorTestsCase
- Class for testing FeedAPI error-proofness. Various tests for invalid input and misconfiguration handling.
Code
function testFeedAPI_Invalid_URL() {
$this
->create_type(array_pop($this
->get_parsers()));
$settings = feedapi_get_settings($this->info->type);
$this
->feedapi_user();
$feedapi_url = "http://" . $this
->randomName(20, '') . "." . $this
->randomName(2, '');
$edit = array(
'feedapi[feedapi_url]' => $feedapi_url,
'title' => $this
->randomName(10),
);
$this
->drupalPost('node/add/' . $this->info->type, $edit, 'Save');
$node = db_result(db_query("SELECT nid FROM {feedapi} WHERE url = '%s'", $edit['feedapi[feedapi_url]']));
$this
->assertTrue($node != FALSE, 'The inaccessible feed URL was inserted in the database.');
}