private function ParagraphsAdministrationTest::countRevisions in Paragraphs 8
Same name in this branch
- 8 tests/src/Functional/WidgetLegacy/ParagraphsAdministrationTest.php \Drupal\Tests\paragraphs\Functional\WidgetLegacy\ParagraphsAdministrationTest::countRevisions()
- 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/ WidgetStable/ ParagraphsAdministrationTest.php - Tests the revision of paragraphs.
File
- tests/
src/ Functional/ WidgetStable/ ParagraphsAdministrationTest.php, line 561
Class
- ParagraphsAdministrationTest
- Tests the configuration of paragraphs.
Namespace
Drupal\Tests\paragraphs\Functional\WidgetStableCode
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);
}