function EntityTypeTest::testIsRevisionable

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::testIsRevisionable()
  2. 10 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::testIsRevisionable()
  3. 11.x core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::testIsRevisionable()

Tests the isRevisionable() method.

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php, line 148

Class

EntityTypeTest
@coversDefaultClass \Drupal\Core\Entity\EntityType @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testIsRevisionable() {
    $entity_type = $this->setUpEntityType([
        'entity_keys' => [
            'id' => 'id',
        ],
    ]);
    $this->assertFalse($entity_type->isRevisionable());
    $entity_type = $this->setUpEntityType([
        'entity_keys' => [
            'id' => 'id',
            'revision' => FALSE,
        ],
    ]);
    $this->assertFalse($entity_type->isRevisionable());
    $entity_type = $this->setUpEntityType([
        'entity_keys' => [
            'id' => 'id',
            'revision' => TRUE,
        ],
    ]);
    $this->assertTrue($entity_type->isRevisionable());
}

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