public function AggregatorTestBase::createSampleNodes in Drupal 9
Same name and namespace in other branches
- 8 core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php \Drupal\Tests\aggregator\Functional\AggregatorTestBase::createSampleNodes()
Creates sample article nodes.
Parameters
int $count: (optional) The number of nodes to generate. Defaults to five.
8 calls to AggregatorTestBase::createSampleNodes()
- AggregatorCronTest::testCron in core/
modules/ aggregator/ tests/ src/ Functional/ AggregatorCronTest.php - Adds feeds and updates them via cron process.
- AggregatorDisplayConfigurableTest::testItemDisplayConfigurable in core/
modules/ aggregator/ tests/ src/ Functional/ AggregatorDisplayConfigurableTest.php - Sets item base fields to configurable display and checks settings are respected.
- AggregatorRenderingTest::testBlockLinks in core/
modules/ aggregator/ tests/ src/ Functional/ AggregatorRenderingTest.php - Adds a feed block to the page and checks its links.
- AggregatorRenderingTest::testFeedPage in core/
modules/ aggregator/ tests/ src/ Functional/ AggregatorRenderingTest.php - Creates a feed and checks that feed's page.
- FeedFetcherPluginTest::setUp in core/
modules/ aggregator/ tests/ src/ Functional/ FeedFetcherPluginTest.php
File
- core/
modules/ aggregator/ tests/ src/ Functional/ AggregatorTestBase.php, line 390
Class
- AggregatorTestBase
- Defines a base class for testing the Aggregator module.
Namespace
Drupal\Tests\aggregator\FunctionalCode
public function createSampleNodes($count = 5) {
// Post $count article nodes.
for ($i = 0; $i < $count; $i++) {
$edit = [];
$edit['title[0][value]'] = $this
->randomMachineName();
$edit['body[0][value]'] = $this
->randomMachineName();
$this
->drupalGet('node/add/article');
$this
->submitForm($edit, 'Save');
}
}