function ArgumentSummaryTest::createTag

Same name and namespace in other branches
  1. 10 core/modules/views/tests/src/Kernel/Handler/ArgumentSummaryTest.php \Drupal\Tests\views\Kernel\Handler\ArgumentSummaryTest::createTag()

Creates a term in the tag vocabulary.

Return value

\Drupal\taxonomy\TermInterface The created term.

1 call to ArgumentSummaryTest::createTag()
ArgumentSummaryTest::testArgumentSummary in core/modules/views/tests/src/Kernel/Handler/ArgumentSummaryTest.php
Tests the argument summary feature.

File

core/modules/views/tests/src/Kernel/Handler/ArgumentSummaryTest.php, line 109

Class

ArgumentSummaryTest
Tests the summary of results when an argument is not provided.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

protected function createTag() : TermInterface {
  $tag = Term::create([
    'name' => $this->randomMachineName(),
    'vid' => $this->tagVocabulary
      ->id(),
  ]);
  $tag->save();
  return $tag;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.