function ContentPreprocessTest::testIsLatestVersionPage

Same name and namespace in other branches
  1. 11.x core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php \Drupal\Tests\content_moderation\Unit\ContentPreprocessTest::testIsLatestVersionPage()
  2. 10 core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php \Drupal\Tests\content_moderation\Unit\ContentPreprocessTest::testIsLatestVersionPage()
  3. 9 core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php \Drupal\Tests\content_moderation\Unit\ContentPreprocessTest::testIsLatestVersionPage()
  4. 8.9.x core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php \Drupal\Tests\content_moderation\Unit\ContentPreprocessTest::testIsLatestVersionPage()

Tests is latest version page.

Attributes

#[DataProvider('routeNodeProvider')]

File

core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php, line 25

Class

ContentPreprocessTest
Tests Drupal\content_moderation\ContentPreprocess.

Namespace

Drupal\Tests\content_moderation\Unit

Code

public function testIsLatestVersionPage($route_name, $route_nid, $check_nid, $result, $message) : void {
  $content_preprocess = new ContentPreprocess($this->setupCurrentRouteMatch($route_name, $route_nid));
  $node = $this->setupNode($check_nid);
  $this->assertEquals($result, $content_preprocess->isLatestVersionPage($node), $message);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.