You are here

public function BaseFieldDefinitionTest::testFieldRevisionable in Drupal 10

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

Tests field revisionable methods.

@covers ::isRevisionable @covers ::setRevisionable

File

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

Class

BaseFieldDefinitionTest
Unit test for BaseFieldDefinition.

Namespace

Drupal\Tests\Core\Entity

Code

public function testFieldRevisionable() {
  $definition = BaseFieldDefinition::create($this->fieldType);
  $this
    ->assertFalse($definition
    ->isRevisionable());
  $definition
    ->setRevisionable(TRUE);
  $this
    ->assertTrue($definition
    ->isRevisionable());
  $definition
    ->setRevisionable(FALSE);
  $this
    ->assertFalse($definition
    ->isRevisionable());
}