function BaseFieldDefinitionTest::testFieldRevisionable

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php \Drupal\Tests\Core\Entity\BaseFieldDefinitionTest::testFieldRevisionable()
  2. 8.9.x core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php \Drupal\Tests\Core\Entity\BaseFieldDefinitionTest::testFieldRevisionable()
  3. 10 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 273

Class

BaseFieldDefinitionTest
Unit test for BaseFieldDefinition.

Namespace

Drupal\Tests\Core\Entity

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.