public function FeedsExamplesOPMLTestCase::test in Feeds 7
Same name and namespace in other branches
- 8.2 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase::test()
- 6 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase::test()
- 7.2 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase::test()
Run tests.
File
- feeds_news/
feeds_news.test, line 133 - Tests for feeds_news feature.
Class
- FeedsExamplesOPMLTestCase
- Test OPML import configuration.
Code
public function test() {
// Import OPML and assert.
$file = $this
->generateOPML();
$this
->importFile('opml', $file);
$this
->assertText('Created 3 feed nodes.');
$count = db_result(db_query("SELECT COUNT(*) FROM {feeds_source}"));
$this
->assertEqual($count, 4, 'Found correct number of items.');
// Import a feed and then delete all items from it.
$this
->drupalPost('node/1/import', array(), 'Import');
$this
->assertText('Created 10 Feed item nodes.');
$this
->drupalPost('node/1/delete-items', array(), 'Delete');
$this
->assertText('Deleted 10 nodes.');
}