function BaseFieldDefinitionTest::testFieldTranslatable
Tests field translatable methods.
@covers ::isTranslatable
      
    
@covers ::setTranslatable
      
    
File
- 
              core/
tests/ Drupal/ Tests/ Core/ Entity/ BaseFieldDefinitionTest.php, line 258  
Class
- BaseFieldDefinitionTest
 - Unit test for BaseFieldDefinition.
 
Namespace
Drupal\Tests\Core\EntityCode
public function testFieldTranslatable() : void {
  $definition = BaseFieldDefinition::create($this->fieldType);
  $this->assertFalse($definition->isTranslatable());
  $definition->setTranslatable(TRUE);
  $this->assertTrue($definition->isTranslatable());
  $definition->setTranslatable(FALSE);
  $this->assertFalse($definition->isTranslatable());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.