You are here

public function DataLayerKernelTest::setupMockNode in dataLayer 8

Setup mock node.

3 calls to DataLayerKernelTest::setupMockNode()
DataLayerKernelTest::setupMockNodeWithTerm in tests/src/Kernel/DataLayerKernelTest.php
Setup mock node.
DataLayerKernelTest::setupMockRouteMatch in tests/src/Kernel/DataLayerKernelTest.php
Setup Mock RouteMatch.
DataLayerKernelTest::testDataLayerGetEntityTermsReturnsEmptyArray in tests/src/Kernel/DataLayerKernelTest.php
Test DataLayer Get Entity Terms Returns Empty Array.

File

tests/src/Kernel/DataLayerKernelTest.php, line 224

Class

DataLayerKernelTest
Kernel test cases for datalayer module.

Namespace

Drupal\Tests\datalayer\Kernel

Code

public function setupMockNode() {
  $this
    ->setupMockUser();

  // Create a node.
  $data = [
    'uid' => $this->user
      ->id(),
    'name' => 'admin',
    'type' => 'article',
    'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
    'title' => 'My Article',
    'status' => 1,
    'nid' => 1,
    'vid' => 1,
    'type' => 'article',
    'created' => '1435019805',
  ];
  $this->node = Node::create($data);
  $this->node
    ->save();
}