protected function ContentEntitySourceContentModerationTest::assertNodeTranslationsRevisionsCount

Asserts number of revisions for the given node ID and language code.

2 calls to ContentEntitySourceContentModerationTest::assertNodeTranslationsRevisionsCount()
ContentEntitySourceContentModerationTest::testModeratedContentTranslations in sources/content/tests/src/Functional/ContentEntitySourceContentModerationTest.php
Test the content moderation workflow with translatable nodes.
ContentEntitySourceContentModerationTest::testNonModeratedContentTranslations in sources/content/tests/src/Functional/ContentEntitySourceContentModerationTest.php
Test the non-moderated workflow with translatable nodes.

File

sources/content/tests/src/Functional/ContentEntitySourceContentModerationTest.php, line 516

Class

ContentEntitySourceContentModerationTest
Tests content entity source integration with content moderation.

Namespace

Drupal\Tests\tmgmt_content\Functional

Code

protected function assertNodeTranslationsRevisionsCount($id, $langcode, $expected) {
  $translation_revisions_count = \Drupal::entityQuery('node')
    ->accessCheck(FALSE)
    ->condition('nid', $id)
    ->condition('langcode', $langcode)
    ->allRevisions()
    ->count()
    ->execute();
  $this
    ->assertEquals($expected, $translation_revisions_count);
}