protected function ContentPreprocessTest::setupNode in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php \Drupal\Tests\content_moderation\Unit\ContentPreprocessTest::setupNode()
Mock a node object.
Parameters
int $nid: The node ID to mock.
Return value
\Drupal\node\Entity\Node The mocked node.
2 calls to ContentPreprocessTest::setupNode()
- ContentPreprocessTest::setupCurrentRouteMatch in core/
modules/ content_moderation/ tests/ src/ Unit/ ContentPreprocessTest.php - Mock the current route matching object.
- ContentPreprocessTest::testIsLatestVersionPage in core/
modules/ content_moderation/ tests/ src/ Unit/ ContentPreprocessTest.php - @covers ::isLatestVersionPage @dataProvider routeNodeProvider
File
- core/
modules/ content_moderation/ tests/ src/ Unit/ ContentPreprocessTest.php, line 66
Class
- ContentPreprocessTest
- @coversDefaultClass \Drupal\content_moderation\ContentPreprocess
Namespace
Drupal\Tests\content_moderation\UnitCode
protected function setupNode($nid) {
$node = $this
->prophesize(Node::class);
$node
->id()
->willReturn($nid);
return $node
->reveal();
}