protected function TaxonomyIndexTidFilterTest::setUp in Drupal 8
Same name and namespace in other branches
- 9 core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyIndexTidFilterTest::setUp()
Parameters
bool $import_test_views: Should the views specified on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.
Overrides TaxonomyTestBase::setUp
File
- core/
modules/ taxonomy/ tests/ src/ Kernel/ Views/ TaxonomyIndexTidFilterTest.php, line 32
Class
- TaxonomyIndexTidFilterTest
- Test the taxonomy term index filter.
Namespace
Drupal\Tests\taxonomy\Kernel\ViewsCode
protected function setUp($import_test_views = TRUE) {
parent::setUp(FALSE);
// Setup vocabulary and terms so the initial import is valid.
Vocabulary::create([
'vid' => 'tags',
'name' => 'Tags',
])
->save();
// This will get a term ID of 3.
$term = Term::create([
'vid' => 'tags',
'name' => 'muh',
]);
$term
->save();
// This will get a term ID of 4.
$this->terms[$term
->id()] = $term;
$term = Term::create([
'vid' => 'tags',
'name' => 'muh',
]);
$term
->save();
$this->terms[$term
->id()] = $term;
ViewTestData::createTestViews(get_class($this), [
'taxonomy_test_views',
]);
}