public function FeedsSyndicationParserTestCase::test in Feeds 7.2
Same name and namespace in other branches
- 6 tests/feeds_parser_syndication.test \FeedsSyndicationParserTestCase::test()
- 7 tests/feeds_parser_syndication.test \FeedsSyndicationParserTestCase::test()
Run tests.
File
- tests/
feeds_parser_syndication.test, line 27 - Tests for plugins/FeedsSyndicationParser.inc.
Class
- FeedsSyndicationParserTestCase
- Test single feeds.
Code
public function test() {
// Only download simplepie if the plugin doesn't already exist somewhere.
// People running tests locally might have it.
if (!feeds_simplepie_exists()) {
$this
->downloadExtractSimplePie('1.3');
$this
->assertTrue(feeds_simplepie_exists());
// Reset all the caches!
$this
->resetAll();
}
$this
->createImporterConfiguration('Syndication', 'syndication');
foreach (array(
'FeedsSyndicationParser',
'FeedsSimplePieParser',
) as $parser) {
$this
->setPlugin('syndication', $parser);
foreach ($this
->feedUrls() as $url => $assertions) {
$this
->createFeedNode('syndication', $url);
$this
->assertText('Created ' . $assertions['item_count'] . ' nodes');
}
}
feeds_include_simplepie();
variable_set('feeds_never_use_curl', TRUE);
$link = $GLOBALS['base_url'] . '/testing/feeds/flickr.xml';
$enclosure = new FeedsSimplePieEnclosure(new SimplePie_Enclosure($link));
$enclosure
->setAllowedExtensions('xml');
$this
->assertEqual(1, $enclosure
->getFile('public://')->fid);
}