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 drupal/modules/aggregator/aggregator.test
Adds feeds and updates them via cron process.
AggregatorRenderingTestCase::testBlockLinks in drupal/modules/aggregator/aggregator.test
Adds a feed block to the page and checks its links.
AggregatorRenderingTestCase::testFeedPage in drupal/modules/aggregator/aggregator.test
Creates a feed and checks that feed's page.
CategorizeFeedItemTestCase::testCategorizeFeedItem in drupal/modules/aggregator/aggregator.test
Checks that children of a feed inherit a defined category.
CategorizeFeedTestCase::testCategorizeFeed in drupal/modules/aggregator/aggregator.test
Creates a feed and makes sure you can add/delete categories to it.

... See full list

File

drupal/modules/aggregator/aggregator.test, line 301
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'));
  }
}