You are here

public function PathautoKernelTest::testTaxonomyPattern in Pathauto 8

Tests aliases on taxonomy terms.

File

tests/src/Kernel/PathautoKernelTest.php, line 412

Class

PathautoKernelTest
Unit tests for Pathauto functions.

Namespace

Drupal\Tests\pathauto\Kernel

Code

public function testTaxonomyPattern() {

  // Create a vocabulary and test that it's pattern variable works.
  $this
    ->addVocabulary([
    'vid' => 'name',
  ]);
  $this
    ->createPattern('taxonomy_term', 'base');
  $pattern = $this
    ->createPattern('taxonomy_term', 'bundle', -1);
  $this
    ->addBundleCondition($pattern, 'taxonomy_term', 'name');
  $pattern
    ->save();
  $this
    ->assertEntityPattern('taxonomy_term', 'name', Language::LANGCODE_NOT_SPECIFIED, 'bundle');
}