You are here

public function ModerationLocaleTest::assertNoModerationForm 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::assertNoModerationForm()

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

Parameters

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

2 calls to ModerationLocaleTest::assertNoModerationForm()
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 550

Class

ModerationLocaleTest
Test content_moderation functionality with localization and translation.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function assertNoModerationForm(NodeInterface $node) {
  $this
    ->drupalGet($node
    ->toUrl());
  $this
    ->assertFalse($this
    ->hasModerationForm());
  $this
    ->drupalGet($node
    ->toUrl('latest-version'));
  $this
    ->assertEquals(403, $this
    ->getSession()
    ->getStatusCode());
}