You are here

private function ParagraphsAdministrationTest::countRevisions in Paragraphs 8

Same name in this branch
  1. 8 tests/src/Functional/WidgetLegacy/ParagraphsAdministrationTest.php \Drupal\Tests\paragraphs\Functional\WidgetLegacy\ParagraphsAdministrationTest::countRevisions()
  2. 8 tests/src/Functional/WidgetStable/ParagraphsAdministrationTest.php \Drupal\Tests\paragraphs\Functional\WidgetStable\ParagraphsAdministrationTest::countRevisions()

Helper function for revision counting.

1 call to ParagraphsAdministrationTest::countRevisions()
ParagraphsAdministrationTest::testParagraphsRevisions in tests/src/Functional/WidgetLegacy/ParagraphsAdministrationTest.php
Tests the revision of paragraphs.

File

tests/src/Functional/WidgetLegacy/ParagraphsAdministrationTest.php, line 550

Class

ParagraphsAdministrationTest
Tests the configuration of paragraphs.

Namespace

Drupal\Tests\paragraphs\Functional\WidgetLegacy

Code

private function countRevisions($node, $paragraph1, $paragraph2, $revisions_count) {
  $node_revisions_count = \Drupal::entityQuery('node')
    ->condition('nid', $node
    ->id())
    ->allRevisions()
    ->count()
    ->execute();
  $this
    ->assertEquals($node_revisions_count, $revisions_count);
  $this
    ->assertEquals(\Drupal::entityQuery('paragraph')
    ->condition('id', $paragraph1)
    ->allRevisions()
    ->count()
    ->execute(), $revisions_count);
  $this
    ->assertEquals(\Drupal::entityQuery('paragraph')
    ->condition('id', $paragraph2)
    ->allRevisions()
    ->count()
    ->execute(), $revisions_count);
}