function ArgumentSummaryTest::createTag

Creates a term in the tag vocabulary.

Return value

\Drupal\taxonomy\TermInterface $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 107

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.