function NodeLinksTest::setUp

Same name and namespace in other branches
  1. main core/modules/node/tests/src/Kernel/NodeLinksTest.php \Drupal\Tests\node\Kernel\NodeLinksTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/node/tests/src/Kernel/NodeLinksTest.php, line 43

Class

NodeLinksTest
Tests the output of node links (read more, add new comment, etc).

Namespace

Drupal\Tests\node\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this->installEntitySchema('user');
  $this->installEntitySchema('node');
  $this->installConfig([
    'filter',
  ]);
  $this->installConfig([
    'node',
  ]);
  $this->setUpCurrentUser(permissions: [
    'access content',
  ]);
  DateFormat::create([
    'id' => 'fallback',
    'label' => 'Fallback',
    'pattern' => 'Y-m-d',
  ])->save();
  $node_type = NodeType::create([
    'type' => 'article',
    'name' => 'Article',
  ]);
  $node_type->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.