You are here

public function EntityContext::onNodeCreate in Lightning Core 8

Same name and namespace in other branches
  1. 8.5 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::onNodeCreate()
  2. 8.2 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::onNodeCreate()
  3. 8.3 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::onNodeCreate()
  4. 8.4 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::onNodeCreate()

Reacts when a node is created by Drupal Extension's step definition.

@BeforeNodeCreate

File

tests/contexts/EntityContext.behat.inc, line 237

Class

EntityContext
Contains miscellaneous step definitions for working with Drupal entities.

Namespace

Acquia\LightningExtension\Context

Code

public function onNodeCreate(BeforeNodeCreateScope $scope) {
  $node = $scope
    ->getEntity();
  if (!isset($node->uid)) {
    $node->uid = $this
      ->getUser();
  }
}