function AggregatorTestBase::createSampleNodes

Creates sample article nodes.

Parameters

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

9 calls to AggregatorTestBase::createSampleNodes()
AggregatorCronTest::testCron in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorCronTest.php
Adds feeds and updates them via cron process.
AggregatorRenderingTest::testBlockLinks in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
Adds a feed block to the page and checks its links.
AggregatorRenderingTest::testFeedPage in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
Creates a feed and checks that feed's page.
BlockLanguageCacheTest::testBlockLinks in drupal/core/modules/block/lib/Drupal/block/Tests/BlockLanguageCacheTest.php
Creates a block in a language, check blocks page in all languages.
CategorizeFeedItemTest::testCategorizeFeedItem in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php
Checks that children of a feed inherit a defined category.

... See full list

File

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

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

function createSampleNodes($count = 5) {
  $langcode = Language::LANGCODE_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'));
  }
}