You are here

public function ContentEntityBaseUnitTest::testIsDefaultRevision in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php \Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest::testIsDefaultRevision()

@covers ::isDefaultRevision

File

core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php, line 264
Contains \Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest.

Class

ContentEntityBaseUnitTest
@coversDefaultClass \Drupal\Core\Entity\ContentEntityBase @group Entity @group Access

Namespace

Drupal\Tests\Core\Entity

Code

public function testIsDefaultRevision() {

  // The default value is TRUE.
  $this
    ->assertTrue($this->entity
    ->isDefaultRevision());

  // Change the default revision, verify that the old value is returned.
  $this
    ->assertTrue($this->entity
    ->isDefaultRevision(FALSE));

  // The last call changed the return value for this call.
  $this
    ->assertFalse($this->entity
    ->isDefaultRevision());
}