Tests error handling when an invalid feed is added.
function testInvalidFeed() {
// Simulate a typo in the URL to force a curl exception.
$invalid_url = 'http:/www.drupal.org';
$feed = entity_create('aggregator_feed', array(
'url' => $invalid_url,
'title' => $this
->randomName(),
));
$feed
->save();
// Update the feed. Use the UI to be able to check the message easily.
$this
->drupalGet('admin/config/services/aggregator');
$this
->clickLink(t('Update items'));
$this
->assertRaw(t('The feed from %title seems to be broken because of error', array(
'%title' => $feed
->label(),
)));
}