function AggregatorTestBase::createSampleNodes

Creates sample article nodes.

Parameters

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

5 calls to AggregatorTestBase::createSampleNodes()
AggregatorCronTest::testCron in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorCronTest.php
Add feeds update them on cron.
AggregatorRenderingTest::testBlockLinks in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
Add a feed block to the page and checks its links.
AggregatorRenderingTest::testFeedPage in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
Create a feed and check that feed's page.
CategorizeFeedItemTest::testCategorizeFeedItem in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php
If a feed has a category, make sure that the children inherit that categorization.
UpdateFeedItemTest::testUpdateFeedItem in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php
Test running "update items" from the 'admin/config/services/aggregator' page.

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php, line 305
Definition of Drupal\aggregator\Tests\AggregatorTestBase.

Class

AggregatorTestBase
Defines a base class for testing aggregator.module.

Namespace

Drupal\aggregator\Tests

Code

function createSampleNodes($count = 5) {
  $langcode = LANGUAGE_NOT_SPECIFIED;

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