You are here

public function ModerationLocaleTest::assertModerationForm in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php \Drupal\Tests\content_moderation\Functional\ModerationLocaleTest::assertModerationForm()

Asserts that the moderation form is displayed for the specified node.

Parameters

\Drupal\node\NodeInterface $node: A node object.

bool $latest_tab: (optional) Whether the node form is expected to be displayed on the latest version page or on the node view page. Defaults to the former.

3 calls to ModerationLocaleTest::assertModerationForm()
ModerationLocaleTest::assertLatestVersionPage in core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
Asserts that this is the "latest version" page for the specified node.
ModerationLocaleTest::assertNotLatestVersionPage in core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
Asserts that this is not the "latest version" page for the specified node.
ModerationLocaleTest::testLanguageIndependentContentModeration in core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
Tests that individual translations can be moderated independently.

File

core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php, line 537

Class

ModerationLocaleTest
Test content_moderation functionality with localization and translation.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function assertModerationForm(NodeInterface $node, $latest_tab = TRUE) {
  $this
    ->drupalGet($node
    ->toUrl());
  $this
    ->assertEquals(!$latest_tab, $this
    ->hasModerationForm());
  $this
    ->drupalGet($node
    ->toUrl('latest-version'));
  $this
    ->assertEquals($latest_tab, $this
    ->hasModerationForm());
}