protected function LinkViewsTokensTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php \Drupal\Tests\link\Functional\Views\LinkViewsTokensTest::setUp()
Overrides ViewTestBase::setUp
File
- core/
modules/ link/ tests/ src/ Functional/ Views/ LinkViewsTokensTest.php, line 46
Class
- LinkViewsTokensTest
- Tests the views integration for link tokens.
Namespace
Drupal\Tests\link\Functional\ViewsCode
protected function setUp($import_test_views = TRUE) : void {
parent::setUp($import_test_views);
ViewTestData::createTestViews(static::class, [
'link_test_views',
]);
// Create Basic page node type.
$this
->drupalCreateContentType([
'type' => 'page',
'name' => 'Basic page',
]);
// Create a field.
FieldStorageConfig::create([
'field_name' => $this->fieldName,
'type' => 'link',
'entity_type' => 'node',
'cardinality' => 1,
])
->save();
FieldConfig::create([
'field_name' => $this->fieldName,
'entity_type' => 'node',
'bundle' => 'page',
'label' => 'link field',
])
->save();
}