You are here

private function WidgetTest::createDummyNodes in Block field 8

Create dummy nodes.

Parameters

string $bundle: The bundle type to create.

int $numberOfNodes: The number of nodes to create.

Return value

\Drupal\node\NodeInterface[] And array of created nodes.

1 call to WidgetTest::createDummyNodes()
WidgetTest::testBlockSettingsAreStoredCorrectly in tests/src/Functional/WidgetTest.php
Test block settings are stored correctly.

File

tests/src/Functional/WidgetTest.php, line 179

Class

WidgetTest
Test the block field widget.

Namespace

Drupal\Tests\block_field\Functional

Code

private function createDummyNodes($bundle, $numberOfNodes) {
  $nodes = [];
  for ($i = 0; $i < $numberOfNodes; $i++) {
    $nodes[] = $this
      ->createNode([
      'type' => $bundle,
    ]);
  }
  return $nodes;
}