You are here

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

Same name and namespace in other branches
  1. 8 modules/rh_taxonomy/tests/src/Functional/TaxonomyBehaviorInvocationTest.php \Drupal\Tests\rh_taxonomy\Functional\TaxonomyBehaviorInvocationTest::createEntity()

Creates new entity.

Parameters

string $action: Rabbit Hole action.

Return value

\Drupal\Core\Entity\EntityInterface Created entity.

Overrides RabbitHoleBehaviorInvocationTestBase::createEntity

File

modules/rh_taxonomy/tests/src/Functional/TaxonomyBehaviorInvocationTest.php, line 51

Class

TaxonomyBehaviorInvocationTest
Test that rabbit hole behaviors are invoked correctly for taxonomy terms.

Namespace

Drupal\Tests\rh_taxonomy\Functional

Code

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