You are here

protected function TaxonomyBehaviorInvocationTest::createEntityBundle in Rabbit Hole 8

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

Creates new entity bundle.

Parameters

string $action: Rabbit Hole action.

Return value

string ID of the created bundle.

Overrides RabbitHoleBehaviorInvocationTestBase::createEntityBundle

File

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

Class

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

Namespace

Drupal\Tests\rh_taxonomy\Functional

Code

protected function createEntityBundle($action = NULL) {
  $this->vocabulary = $this
    ->createVocabulary();
  if (isset($action)) {
    $this->behaviorSettingsManager
      ->saveBehaviorSettings([
      'action' => $action,
      'allow_override' => TRUE,
    ], 'taxonomy_vocabulary', $this->vocabulary
      ->id());
  }
  return $this->vocabulary
    ->id();
}