You are here

public function TaxonomyDefaultArgumentTest::testNodePath in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyDefaultArgumentTest::testNodePath()
  2. 9 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyDefaultArgumentTest::testNodePath()

Tests the relationship.

File

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

Class

TaxonomyDefaultArgumentTest
Tests the representative node relationship for terms.

Namespace

Drupal\Tests\taxonomy\Kernel\Views

Code

public function testNodePath() {
  $view = $this
    ->initViewWithRequest($this->nodes[0]
    ->toUrl()
    ->toString());
  $expected = implode(',', [
    $this->term1
      ->id(),
    $this->term2
      ->id(),
  ]);
  $this
    ->assertEquals($expected, $view->argument['tid']
    ->getDefaultArgument());
  $view
    ->destroy();
}