You are here

public function TaxonomyUniqueTest::testDuplicateTermWithTuDisabled in Taxonomy unique 8.2

Tests the basic functionality with taxonomy_unique turned off in the vocabulary settings.

File

tests/src/Kernel/TaxonomyUniqueTest.php, line 56

Class

TaxonomyUniqueTest
Tests for taxonomy unique module.

Namespace

Drupal\Tests\taxonomy_unique\Kernel

Code

public function testDuplicateTermWithTuDisabled() {
  $vocabulary = $this
    ->createVocabulary();
  $t1 = $this
    ->createTerm($vocabulary, [
    'name' => 'Term 1',
  ]);
  $t1_violations = $t1
    ->validate();
  $this
    ->assertEquals(0, $t1_violations
    ->count());
  $t2 = $this
    ->createTerm($vocabulary, [
    'name' => 'Term 1',
  ]);
  $t2_violations = $t2
    ->validate();
  $this
    ->assertEquals(0, $t2_violations
    ->count());
}