function FieldPluginBaseTest::setupTestField

Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setupTestField()
  2. 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setupTestField()
  3. 10 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setupTestField()

Sets up a test field.

Return value

\Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTestField The test field.

12 calls to FieldPluginBaseTest::setupTestField()
FieldPluginBaseTest::testElementClassesWithTokens in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
Ensures proper token replacement when generating CSS classes.
FieldPluginBaseTest::testGetRenderTokensWithArguments in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@covers ::getRenderTokens
FieldPluginBaseTest::testGetRenderTokensWithoutArguments in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@covers ::getRenderTokens
FieldPluginBaseTest::testGetRenderTokensWithoutFieldsAndArguments in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@covers ::getRenderTokens
FieldPluginBaseTest::testGetRenderTokensWithQuery in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@dataProvider providerTestGetRenderTokensWithQuery @covers ::getRenderTokens @covers ::getTokenValuesRecursive

... See full list

File

core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php, line 645

Class

FieldPluginBaseTest
@coversDefaultClass \Drupal\views\Plugin\views\field\FieldPluginBase @group views

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

protected function setupTestField(array $options = []) {
    $field = new FieldPluginBaseTestField($this->configuration, $this->pluginId, $this->pluginDefinition);
    $field->init($this->executable, $this->display, $options);
    $field->setLinkGenerator($this->linkGenerator);
    return $field;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.