function AggregatorTestCase::createSampleNodes
Creates sample article nodes.
Parameters
$count: (optional) The number of nodes to generate. Defaults to five.
6 calls to AggregatorTestCase::createSampleNodes()
- AggregatorCronTestCase::testCron in modules/
aggregator/ aggregator.test - Adds feeds and updates them via cron process.
- AggregatorRenderingTestCase::testBlockLinks in modules/
aggregator/ aggregator.test - Adds a feed block to the page and checks its links.
- AggregatorRenderingTestCase::testFeedPage in modules/
aggregator/ aggregator.test - Creates a feed and checks that feed's page.
- CategorizeFeedItemTestCase::testCategorizeFeedItem in modules/
aggregator/ aggregator.test - Checks that children of a feed inherit a defined category.
- CategorizeFeedTestCase::testCategorizeFeed in modules/
aggregator/ aggregator.test - Creates a feed and makes sure you can add/delete categories to it.
File
-
modules/
aggregator/ aggregator.test, line 301
Class
- AggregatorTestCase
- Defines a base class for testing the Aggregator module.
Code
function createSampleNodes($count = 5) {
$langcode = LANGUAGE_NONE;
// Post $count article nodes.
for ($i = 0; $i < $count; $i++) {
$edit = array();
$edit['title'] = $this->randomName();
$edit["body[{$langcode}][0][value]"] = $this->randomName();
$this->drupalPost('node/add/article', $edit, t('Save'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.