You are here

public function ArgumentValidatorTest::testViewsWithTaxonomyTermNameArgument in Views taxonomy term name into ID 8

Tests view results with taxonomy term name as ID validator.

File

tests/src/Functional/ArgumentValidatorTest.php, line 102

Class

ArgumentValidatorTest
Tests the taxonomy term name transformed into ID argument validator.

Namespace

Drupal\Tests\views_taxonomy_term_name_into_id\Functional

Code

public function testViewsWithTaxonomyTermNameArgument() {

  // Test the view with results.
  $this
    ->drupalGet('test_argument_taxonomy_name_into_id/' . $this->terms[1]
    ->getName());
  $this
    ->assertLink($this->node
    ->label());

  // Test the view with no results found.
  $this
    ->drupalGet('test_argument_taxonomy_name_into_id/' . $this->terms[2]
    ->getName());
  $this
    ->assertResponse(200);
  $this
    ->assertNoLink($this->node
    ->label());

  // Test the view with an invalid argument.
  $this
    ->drupalGet('test_argument_taxonomy_name_into_id/xyz');
  $this
    ->assertResponse(404);
}