You are here

public function FieldDefaultTokenBasicTest::testCallbackNewField in Field default token 8

Tests that the default value callback is registered for a new field.

File

tests/src/Kernel/FieldDefaultTokenBasicTest.php, line 45

Class

FieldDefaultTokenBasicTest
Tests that tokens in field default values get replaced correctly.

Namespace

Drupal\Tests\field_default_token\Kernel

Code

public function testCallbackNewField() {
  $field = $this
    ->createField();
  $field
    ->setDefaultValue('This is the site name: [site:name]')
    ->save();
  $this
    ->assertEquals('field_default_token_default_value_callback', $field
    ->getDefaultValueCallback());
}