You are here

protected function PathPluginTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/tests/src/Functional/Views/PathPluginTest.php \Drupal\Tests\node\Functional\Views\PathPluginTest::setUp()
  2. 9 core/modules/node/tests/src/Functional/Views/PathPluginTest.php \Drupal\Tests\node\Functional\Views\PathPluginTest::setUp()

Overrides NodeTestBase::setUp

File

core/modules/node/tests/src/Functional/Views/PathPluginTest.php, line 43

Class

PathPluginTest
Tests the node row plugin.

Namespace

Drupal\Tests\node\Functional\Views

Code

protected function setUp($import_test_views = TRUE, $modules = [
  'node_test_views',
]) : void {
  parent::setUp($import_test_views, $modules);
  $this
    ->drupalCreateContentType([
    'type' => 'article',
  ]);

  // Create two nodes.
  for ($i = 0; $i < 2; $i++) {
    $this->nodes[] = $this
      ->drupalCreateNode([
      'type' => 'article',
      'body' => [
        [
          'value' => $this
            ->randomMachineName(42),
          'format' => filter_default_format(),
          'summary' => $this
            ->randomMachineName(),
        ],
      ],
    ]);
  }
}