You are here

protected function UserBehaviorInvocationTest::createEntity in Rabbit Hole 2.x

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

Code

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