You are here

public function NameNodeTokenReplaceTest::setUp in Name Field 8

Overrides NameTestBase::setUp

File

tests/src/Functional/NameNodeTokenReplaceTest.php, line 43

Class

NameNodeTokenReplaceTest
Tests text replacements in content to check node name token replacement.

Namespace

Drupal\Tests\name\Functional

Code

public function setUp() {
  parent::setUp();
  $this->interfaceLanguage = \Drupal::languageManager()
    ->getCurrentLanguage();
  $this->tokenService = \Drupal::token();
  $node_type = NodeType::create([
    'type' => 'article',
    'name' => 'Article',
  ]);
  $node_type
    ->save();
  node_add_body_field($node_type);
  $this
    ->createNameField('field_name', 'node', 'article');
  $this
    ->createNameField('field_realname', 'user', 'user');
}