You are here

public function BaseFieldDefinitionTest::testFieldName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php \Drupal\Tests\Core\Entity\BaseFieldDefinitionTest::testFieldName()

Tests field name methods.

@covers ::getName

File

core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php, line 82
Contains \Drupal\Tests\Core\Entity\BaseFieldDefinitionTest.

Class

BaseFieldDefinitionTest
Unit test for BaseFieldDefinition.

Namespace

Drupal\Tests\Core\Entity

Code

public function testFieldName() {
  $definition = BaseFieldDefinition::create($this->fieldType);
  $field_name = $this
    ->randomMachineName();
  $definition
    ->setName($field_name);
  $this
    ->assertEquals($field_name, $definition
    ->getName());
}