Backup of db before drupal security update
[yaffs-website] / web / core / modules / taxonomy / src / Tests / Views / TaxonomyTermArgumentDepthTest.php
1 <?php
2
3 namespace Drupal\taxonomy\Tests\Views;
4
5 /**
6  * Tests the taxonomy term with depth argument.
7  *
8  * @group taxonomy
9  */
10 class TaxonomyTermArgumentDepthTest extends TaxonomyTestBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public static $modules = ['taxonomy', 'taxonomy_test_views', 'views', 'node'];
16
17   /**
18    * {@inheritdoc}
19    */
20   public static $testViews = ['test_argument_taxonomy_index_tid_depth'];
21
22   /**
23    * @var \Drupal\taxonomy\TermInterface[]
24    */
25   protected $terms = [];
26
27   /**
28    * @var \Drupal\views\ViewExecutable
29    */
30   protected $view;
31
32   /**
33    * {@inheritdoc}
34    */
35   protected function setUp() {
36     parent::setUp();
37
38     // Create a term with markup in the label.
39     $first = $this->createTerm(['name' => '<em>First</em>']);
40
41     // Create a node w/o any terms.
42     $settings = ['type' => 'article'];
43
44     // Create a node with linked to the term.
45     $settings['field_views_testing_tags'][0]['target_id'] = $first->id();
46     $this->nodes[] = $this->drupalCreateNode($settings);
47
48     $this->terms[0] = $first;
49   }
50
51   /**
52    * Tests title escaping.
53    */
54   public function testTermWithDepthArgumentTitleEscaping() {
55     $this->drupalGet('test_argument_taxonomy_index_tid_depth/' . $this->terms[0]->id());
56     $this->assertEscaped($this->terms[0]->label());
57   }
58
59 }