function TaxonomyDefaultArgumentTest::testTermPath

Same name in other branches
  1. 9 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyDefaultArgumentTest::testTermPath()
  2. 8.9.x core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyDefaultArgumentTest::testTermPath()
  3. 11.x core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyDefaultArgumentTest::testTermPath()

File

core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php, line 90

Class

TaxonomyDefaultArgumentTest
Tests the representative node relationship for terms.

Namespace

Drupal\Tests\taxonomy\Kernel\Views

Code

public function testTermPath() : void {
    $view = $this->initViewWithRequest($this->term1
        ->toUrl()
        ->toString());
    $expected = $this->term1
        ->id();
    $this->assertEquals($expected, $view->argument['tid']
        ->getDefaultArgument());
    $this->assertEmpty($view->argument['tid']
        ->getPlugin('argument_default')
        ->getCacheTags());
}

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