You are here

protected function RevisionUiAccessTest::countDefaultLanguageRevisions in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/RevisionUiAccessTest.php \Drupal\Tests\group\Kernel\RevisionUiAccessTest::countDefaultLanguageRevisions()

Counts the number of revisions in the default language.

Parameters

\Drupal\group\Entity\GroupInterface $group: The group.

Return value

int The number of revisions in the default language.

File

tests/src/Kernel/RevisionUiAccessTest.php, line 789

Class

RevisionUiAccessTest
Tests the revision UI access for groups.

Namespace

Drupal\Tests\group\Kernel

Code

protected function countDefaultLanguageRevisions(GroupInterface $group) {
  return (int) $this->entityTypeManager
    ->getStorage('group')
    ->getQuery()
    ->allRevisions()
    ->condition('id', $group
    ->id())
    ->condition('default_langcode', 1)
    ->count()
    ->execute();
}