You are here

protected function NullifyQueueIdTest::createNode in Acquia Content Hub 8.2

Creates node samples.

Return value

\Drupal\node\NodeInterface Node object.

Throws

\Drupal\Core\Entity\EntityStorageException

2 calls to NullifyQueueIdTest::createNode()
NullifyQueueIdTest::testQueueIdNullification in tests/src/Kernel/NullifyQueueIdTest.php
Test "queue_id" nullification when entities loose their queued state.
PublisherTrackerTest::setUp in tests/src/Kernel/PublisherTrackerTest.php

File

tests/src/Kernel/NullifyQueueIdTest.php, line 252

Class

NullifyQueueIdTest
Tests the NullifyQueueId class.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

protected function createNode() : NodeInterface {
  $node = Node::create([
    'title' => $this
      ->randomMachineName(),
    'type' => self::BUNDLE,
    'langcode' => 'en',
    'created' => \Drupal::time()
      ->getRequestTime(),
    'changed' => \Drupal::time()
      ->getRequestTime(),
    'uid' => 1,
    'status' => Node::PUBLISHED,
  ]);
  $node
    ->save();
  return $node;
}