function LinkViewsTokensTest::setUp
Same name in other branches
- 9 core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php \Drupal\Tests\link\Functional\Views\LinkViewsTokensTest::setUp()
- 8.9.x core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php \Drupal\Tests\link\Functional\Views\LinkViewsTokensTest::setUp()
- 10 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 45
Class
- LinkViewsTokensTest
- Tests the views integration for link tokens.
Namespace
Drupal\Tests\link\Functional\ViewsCode
protected function setUp($import_test_views = TRUE, $modules = [
'link_test_views',
]) : void {
parent::setUp($import_test_views, $modules);
// 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();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.