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