vocabularies[] = $this->vocabulary; // Create additional vocabulary. $vocabulary = Vocabulary::create([ 'name' => 'Views testing category', 'vid' => 'views_testing_category', ]); $vocabulary->save(); $this->vocabularies[] = $vocabulary; // Create some terms. $this->terms[0] = $this->createTerm([ 'name' => 'First', 'vid' => $this->vocabularies[0]->id(), ]); $this->terms[1] = $this->createTerm([ 'name' => 'Second', 'vid' => $this->vocabularies[1]->id(), ]); } /** * Tests the vocabulary argument handler. * * @see Drupal\taxonomy\Plugin\views\argument\VocabularyVid */ public function testTermWithVocabularyArgument() { $this->drupalGet('test_argument_taxonomy_vocabulary/' . $this->vocabularies[0]->id()); // First term should be present. $this->assertText($this->terms[0]->label()); // Second term should not be present. $this->assertNoText($this->terms[1]->label()); } }