You are here

protected function EntityReferenceRevisionsCompositeTranslationTest::assertRevisionCount in Entity Reference Revisions 8

Asserts the revision count of an entity.

Parameters

int $expected: The expected amount of revisions.

\Drupal\Core\Entity\EntityInterface $entity: The entity.

3 calls to EntityReferenceRevisionsCompositeTranslationTest::assertRevisionCount()
EntityReferenceRevisionsCompositeTranslationTest::testCompositePendingRevisionTranslation in tests/src/Kernel/EntityReferenceRevisionsCompositeTranslationTest.php
Test the storage for handling pending revisions with translations.
EntityReferenceRevisionsCompositeTranslationTest::testCompositeTranslation in tests/src/Kernel/EntityReferenceRevisionsCompositeTranslationTest.php
Tests that composite translations affects the host entity's translations.
EntityReferenceRevisionsCompositeTranslationTest::testNestedCompositeTranslation in tests/src/Kernel/EntityReferenceRevisionsCompositeTranslationTest.php
Tests that nested composite translations affects the host translations.

File

tests/src/Kernel/EntityReferenceRevisionsCompositeTranslationTest.php, line 632

Class

EntityReferenceRevisionsCompositeTranslationTest
Tests the entity_reference_revisions composite relationship.

Namespace

Drupal\Tests\entity_reference_revisions\Kernel

Code

protected function assertRevisionCount($expected, EntityInterface $entity) {
  $node_revisions_count = \Drupal::entityQuery($entity
    ->getEntityTypeId())
    ->condition($entity
    ->getEntityType()
    ->getKey('id'), $entity
    ->id())
    ->allRevisions()
    ->count()
    ->execute();
  $this
    ->assertEquals($expected, $node_revisions_count);
}