You are here

protected function WorkbenchPreprocessTest::setupNode in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/WorkbenchPreprocessTest.php \Drupal\Tests\workbench_moderation\Unit\WorkbenchPreprocessTest::setupNode()

Mock a node object.

Parameters

int $nid: Node id.

Return value

\Drupal\node\Entity\Node Returns node.

2 calls to WorkbenchPreprocessTest::setupNode()
WorkbenchPreprocessTest::setupCurrentRouteMatch in tests/src/Unit/WorkbenchPreprocessTest.php
Mock the current route matching object.
WorkbenchPreprocessTest::testIsLatestVersionPage in tests/src/Unit/WorkbenchPreprocessTest.php
@covers ::isLatestVersionPage @dataProvider routeNodeProvider

File

tests/src/Unit/WorkbenchPreprocessTest.php, line 73

Class

WorkbenchPreprocessTest
Class WorkbenchPreprocessTest.

Namespace

Drupal\Tests\workbench_moderation\Unit

Code

protected function setupNode($nid) {
  $node = $this
    ->prophesize(Node::class);
  $node
    ->id()
    ->willReturn($nid);
  return $node
    ->reveal();
}