TaxonomyBehaviorInvocationTest.php in Rabbit Hole 8
File
modules/rh_taxonomy/tests/src/Functional/TaxonomyBehaviorInvocationTest.php
View source
<?php
namespace Drupal\Tests\rh_taxonomy\Functional;
use Drupal\Tests\rabbit_hole\Functional\RabbitHoleBehaviorInvocationTestBase;
use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait;
class TaxonomyBehaviorInvocationTest extends RabbitHoleBehaviorInvocationTestBase {
use TaxonomyTestTrait;
protected $entityType = 'taxonomy_term';
public static $modules = [
'rh_taxonomy',
'taxonomy',
];
protected $vocabulary;
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();
}
protected function createEntity($action = NULL) {
$values = [];
if (isset($action)) {
$values['rh_action'] = $action;
}
return $this
->createTerm($this->vocabulary, $values);
}
}