TaxonomyTermArgumentDepthTest.php in Drupal 9
File
core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php
View source
<?php
namespace Drupal\Tests\taxonomy\Functional\Views;
class TaxonomyTermArgumentDepthTest extends TaxonomyTestBase {
protected static $modules = [
'taxonomy',
'taxonomy_test_views',
'views',
'node',
];
protected $defaultTheme = 'stark';
public static $testViews = [
'test_argument_taxonomy_index_tid_depth',
];
protected $terms = [];
protected $view;
protected function setUp($import_test_views = TRUE) : void {
parent::setUp($import_test_views);
$first = $this
->createTerm([
'name' => '<em>First</em>',
]);
$settings = [
'type' => 'article',
];
$settings['field_views_testing_tags'][0]['target_id'] = $first
->id();
$this->nodes[] = $this
->drupalCreateNode($settings);
$this->terms[0] = $first;
}
public function testTermWithDepthArgumentTitleEscaping() {
$this
->drupalGet('test_argument_taxonomy_index_tid_depth/' . $this->terms[0]
->id());
$this
->assertSession()
->assertEscaped($this->terms[0]
->label());
}
}