You are here

public function AggregatorTestBase::createSampleNodes in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/aggregator/src/Tests/AggregatorTestBase.php \Drupal\aggregator\Tests\AggregatorTestBase::createSampleNodes()

Creates sample article nodes.

Parameters

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

7 calls to AggregatorTestBase::createSampleNodes()
AggregatorCronTest::testCron in core/modules/aggregator/src/Tests/AggregatorCronTest.php
Adds feeds and updates them via cron process.
AggregatorRenderingTest::testBlockLinks in core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
Adds a feed block to the page and checks its links.
AggregatorRenderingTest::testFeedPage in core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
Creates a feed and checks that feed's page.
FeedFetcherPluginTest::setUp in core/modules/aggregator/src/Tests/FeedFetcherPluginTest.php
Sets up a Drupal site for running functional and integration tests.
FeedLanguageTest::testFeedLanguage in core/modules/aggregator/src/Tests/FeedLanguageTest.php
Tests creation of feeds with a language.

... See full list

File

core/modules/aggregator/src/Tests/AggregatorTestBase.php, line 355
Contains \Drupal\aggregator\Tests\AggregatorTestBase.

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

public function createSampleNodes($count = 5) {

  // Post $count article nodes.
  for ($i = 0; $i < $count; $i++) {
    $edit = array();
    $edit['title[0][value]'] = $this
      ->randomMachineName();
    $edit['body[0][value]'] = $this
      ->randomMachineName();
    $this
      ->drupalPostForm('node/add/article', $edit, t('Save'));
  }
}