You are here

protected function UserBehaviorSettingsFormTest::createEntity in Rabbit Hole 8

Same name and namespace in other branches
  1. 2.x 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\Functional

Code

protected function createEntity($action = NULL) {
  $values = [];
  if (isset($action)) {
    $values['rh_action'] = $action;
  }
  return $this
    ->drupalCreateUser([], $this
    ->randomMachineName(), FALSE, $values)
    ->id();
}