class TaxonomyTermArgumentDepthTest
Same name in this branch
- 9 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTermArgumentDepthTest
Same name and namespace in other branches
- 11.x core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTermArgumentDepthTest
- 11.x core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentDepthTest
Tests the taxonomy term with depth argument.
@group taxonomy
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase uses \Drupal\Tests\field\Traits\EntityReferenceTestTrait implements \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentDepthTest implements \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase
- class \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase uses \Drupal\Tests\field\Traits\EntityReferenceTestTrait implements \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of TaxonomyTermArgumentDepthTest
File
-
core/
modules/ taxonomy/ tests/ src/ Functional/ Views/ TaxonomyTermArgumentDepthTest.php, line 10
Namespace
Drupal\Tests\taxonomy\Functional\ViewsView source
class TaxonomyTermArgumentDepthTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'taxonomy',
'taxonomy_test_views',
'views',
'node',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
public static $testViews = [
'test_argument_taxonomy_index_tid_depth',
];
/**
* @var \Drupal\taxonomy\TermInterface[]
*/
protected $terms = [];
/**
* @var \Drupal\views\ViewExecutable
*/
protected $view;
/**
* {@inheritdoc}
*/
protected function setUp($import_test_views = TRUE, $modules = []) : void {
parent::setUp($import_test_views, $modules);
// Create a term with markup in the label.
$first = $this->createTerm([
'name' => '<em>First</em>',
]);
// Create a node w/o any terms.
$settings = [
'type' => 'article',
];
// Create a node with linked to the term.
$settings['field_views_testing_tags'][0]['target_id'] = $first->id();
$this->nodes[] = $this->drupalCreateNode($settings);
$this->terms[0] = $first;
}
/**
* Tests title escaping.
*/
public function testTermWithDepthArgumentTitleEscaping() {
$this->drupalGet('test_argument_taxonomy_index_tid_depth/' . $this->terms[0]
->id());
$this->assertSession()
->assertEscaped($this->terms[0]
->label());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.