public function FeedsExamplesOPMLTestCase::test in Feeds 7.2
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 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase::test()
Run tests.
File
- feeds_news/
feeds_news.test, line 123 - 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 nodes');
$count = db_query("SELECT COUNT(*) FROM {feeds_source}")
->fetchField();
$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 nodes');
$this
->drupalPost('node/1/delete-items', array(), 'Delete');
$this
->assertText('Deleted 10 nodes');
}