class FeedsExamplesOPMLTestCase in Feeds 8.2
Same name and namespace in other branches
- 6 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase
- 7.2 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase
- 7 feeds_news/feeds_news.test \FeedsExamplesOPMLTestCase
Test OPML import configuration.
Hierarchy
- class \FeedsExamplesOPMLTestCase extends \FeedsWebTestCase
Expanded class hierarchy of FeedsExamplesOPMLTestCase
File
- feeds_news/
feeds_news.test, line 92 - Tests for feeds_news feature.
View source
class FeedsExamplesOPMLTestCase extends FeedsWebTestCase {
public static function getInfo() {
return array(
'name' => 'Feature: OPML import',
'description' => 'Test "OPML import" default configuration.',
'group' => 'Feeds',
);
}
/**
* Enable feeds_news feature.
*/
public function setUp() {
parent::setUp(array(
'feeds_news',
));
}
/**
* Run tests.
*/
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');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsExamplesOPMLTestCase:: |
public static | function | ||
FeedsExamplesOPMLTestCase:: |
public | function | Enable feeds_news feature. | |
FeedsExamplesOPMLTestCase:: |
public | function | Run tests. |