You are here

public function BaseFieldDefinitionTest::testFieldTranslatable in Drupal 8

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

Tests field translatable methods.

@covers ::isTranslatable @covers ::setTranslatable

File

core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php, line 252

Class

BaseFieldDefinitionTest
Unit test for BaseFieldDefinition.

Namespace

Drupal\Tests\Core\Entity

Code

public function testFieldTranslatable() {
  $definition = BaseFieldDefinition::create($this->fieldType);
  $this
    ->assertFalse($definition
    ->isTranslatable());
  $definition
    ->setTranslatable(TRUE);
  $this
    ->assertTrue($definition
    ->isTranslatable());
  $definition
    ->setTranslatable(FALSE);
  $this
    ->assertFalse($definition
    ->isTranslatable());
}