protected function NodeBehaviorInvocationTest::createEntity in Rabbit Hole 2.x
Same name and namespace in other branches
- 8 modules/rh_node/tests/src/Functional/NodeBehaviorInvocationTest.php \Drupal\Tests\rh_node\Functional\NodeBehaviorInvocationTest::createEntity()
Creates new entity.
Parameters
string $action: Rabbit Hole action.
Return value
\Drupal\Core\Entity\EntityInterface Created entity.
Overrides RabbitHoleBehaviorInvocationTestBase::createEntity
File
- modules/
rh_node/ tests/ src/ Functional/ NodeBehaviorInvocationTest.php, line 45
Class
- NodeBehaviorInvocationTest
- Test that rabbit hole behaviors are invoked correctly for nodes.
Namespace
Drupal\Tests\rh_node\FunctionalCode
protected function createEntity($action = NULL) {
$values = [
'type' => self::TEST_BUNDLE,
];
if (isset($action)) {
$values['rh_action'] = $action;
}
return $this
->drupalCreateNode($values);
}