function TaxonomyTermArgumentTidFromNodeTest::setUp
Same name in this branch
- main core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentTidFromNodeTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentTidFromNodeTest::setUp()
Same name and namespace in other branches
- 11.x core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentTidFromNodeTest.php \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermArgumentTidFromNodeTest::setUp()
Overrides TaxonomyTestBase::setUp
File
-
core/
modules/ taxonomy/ tests/ src/ Kernel/ Views/ TaxonomyTermArgumentTidFromNodeTest.php, line 42
Class
- TaxonomyTermArgumentTidFromNodeTest
- Tests the taxonomy term with argument from a node page.
Namespace
Drupal\Tests\taxonomy\Kernel\ViewsCode
protected function setUp($import_test_views = TRUE) : void {
parent::setUp($import_test_views);
// 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();
\Drupal::service(ThemeInstallerInterface::class)->install([
'stark',
]);
$this->config('system.theme')
->set('default', 'stark')
->save();
$this->installSchema('node', [
'node_access',
]);
$this->drupalPlaceBlock('views_block:test_argument_tid_from_node-block_1');
$this->setUpCurrentUser(permissions: [
'access content',
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.