public function EntityContext::onNodeCreate in Lightning Core 8
Same name and namespace in other branches
- 8.5 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::onNodeCreate()
- 8.2 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::onNodeCreate()
- 8.3 tests/contexts/EntityContext.behat.inc \Acquia\LightningExtension\Context\EntityContext::onNodeCreate()
- 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\ContextCode
public function onNodeCreate(BeforeNodeCreateScope $scope) {
$node = $scope
->getEntity();
if (!isset($node->uid)) {
$node->uid = $this
->getUser();
}
}