function AggregatorTestCase::createSampleNodes

7.x aggregator.test AggregatorTestCase::createSampleNodes($count = 5)

Creates sample article nodes.

Parameters

$count: (optional) The number of nodes to generate. Defaults to five.

5 calls to AggregatorTestCase::createSampleNodes()
AggregatorCronTestCase::testCron in drupal-7.x/modules/aggregator/aggregator.test
Adds feeds and updates them via cron process.
AggregatorRenderingTestCase::testBlockLinks in drupal-7.x/modules/aggregator/aggregator.test
Adds a feed block to the page and checks its links.
AggregatorRenderingTestCase::testFeedPage in drupal-7.x/modules/aggregator/aggregator.test
Creates a feed and checks that feed's page.
CategorizeFeedItemTestCase::testCategorizeFeedItem in drupal-7.x/modules/aggregator/aggregator.test
Checks that children of a feed inherit a defined category.
UpdateFeedItemTestCase::testUpdateFeedItem in drupal-7.x/modules/aggregator/aggregator.test
Tests running "update items" from 'admin/config/services/aggregator' page.

File

drupal-7.x/modules/aggregator/aggregator.test, line 297
Tests for aggregator.module.

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'));
  }
}