class TaxonomyTermArgumentTidFromNodeTest
Tests the taxonomy term with argument from a node page.
Attributes
#[Group('taxonomy')]
#[RunTestsInSeparateProcesses]
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Tests\DrupalTestCaseTrait, \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \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\PhpUnitCompatibilityTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase uses \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait extends \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentTidFromNodeTest extends \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase
- class \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTestBase uses \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait extends \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of TaxonomyTermArgumentTidFromNodeTest
File
-
core/
modules/ taxonomy/ tests/ src/ Functional/ Views/ TaxonomyTermArgumentTidFromNodeTest.php, line 13
Namespace
Drupal\Tests\taxonomy\Functional\ViewsView source
class TaxonomyTermArgumentTidFromNodeTest extends TaxonomyTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'block',
'node',
'taxonomy',
'taxonomy_test_views',
'views',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
public static $testViews = [
'test_argument_tid_from_node',
];
/**
* {@inheritdoc}
*/
protected function setUp($import_test_views = TRUE, $modules = []) : void {
parent::setUp($import_test_views, $modules);
// Remove the term field from the display, replace with the view.
/** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
$display_repository = \Drupal::service('entity_display.repository');
$display_repository->getViewDisplay('node', 'article')
->removeComponent('field_views_testing_tags')
->save();
$this->drupalPlaceBlock('views_block:test_argument_tid_from_node-block_1');
}
/**
* Tests cache invalidation.
*/
public function testCacheInvalidation() : void {
$this->drupalGet($this->nodes[0]
->toUrl());
$this->assertSession()
->pageTextContains($this->term1
->label());
$this->nodes[0]
->set('field_views_testing_tags', [])
->save();
$this->drupalGet($this->nodes[0]
->toUrl());
$this->assertSession()
->pageTextNotContains($this->term1
->label());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.