You are here

public function AutoEntityLabelTest::testEnabledOption in Automatic Entity Label 8.3

Tests node creation with enabled settings.

File

tests/src/Kernel/AutoEntityLabelTest.php, line 85

Class

AutoEntityLabelTest
Tests for auto entity label.

Namespace

Drupal\Tests\auto_entitylabel\Kernel

Code

public function testEnabledOption() {
  $this
    ->setConfiguration([
    'status' => AutoEntityLabelManager::ENABLED,
    'pattern' => '[node:author:name]',
  ]);
  $user = $this
    ->createUser();
  $node = $this
    ->createNode([
    'uid' => $user
      ->id(),
    'type' => $this->nodeType
      ->id(),
  ]);
  $this
    ->assertEquals($user
    ->getAccountName(), $node
    ->getTitle(), 'The title is set.');
}