protected function UserBehaviorSettingsFormTest::createEntity in Rabbit Hole 2.x
Same name and namespace in other branches
- 8 modules/rh_user/tests/src/Functional/UserBehaviorSettingsFormTest.php \Drupal\Tests\rh_user\Functional\UserBehaviorSettingsFormTest::createEntity()
Creates new entity.
Parameters
string $action: Rabbit Hole action.
Return value
int ID of the created entity.
Overrides RabbitHoleBehaviorSettingsFormTestBase::createEntity
File
- modules/
rh_user/ tests/ src/ Functional/ UserBehaviorSettingsFormTest.php, line 78
Class
- UserBehaviorSettingsFormTest
- Test the functionality of the rabbit hole form additions to the user entity.
Namespace
Drupal\Tests\rh_user\FunctionalCode
protected function createEntity($action = NULL) {
$values = [];
if (isset($action)) {
$values['rh_action'] = $action;
}
return $this
->drupalCreateUser([], $this
->randomMachineName(), FALSE, $values)
->id();
}