protected function HierarchicalTaxonomyMenuCacheTest::setUp in Hierarchical Taxonomy Menu 8
Overrides BrowserTestBase::setUp
File
- tests/
src/ Functional/ HierarchicalTaxonomyMenuCacheTest.php, line 55
Class
- HierarchicalTaxonomyMenuCacheTest
- Tests the Hierarchical Taxonomy Menu block caching.
Namespace
Drupal\Tests\hierarchical_taxonomy_menu\FunctionalCode
protected function setUp() {
parent::setUp();
$vocabulary = $this
->createVocabulary();
$this
->createTerm($vocabulary, [
'name' => 'Term 1',
]);
$this
->createTerm($vocabulary, [
'name' => 'Term 2',
]);
$block = $this
->drupalPlaceBlock('hierarchical_taxonomy_menu', [
'region' => 'content',
'label' => 'Hierarchical Taxonomy Menu',
'id' => 'hierarchicaltaxonomymenu',
]);
$block
->set('settings', [
'label' => 'Hierarchical Taxonomy Menu',
'label_display' => 'visible',
'vocabulary' => $vocabulary
->id() . '|',
'dynamic_block_title' => TRUE,
]);
$block
->save();
$this->block = $block;
$user = $this
->drupalCreateUser([
'access content',
]);
$this->user = $user;
}