You are here

protected function FieldPluginBaseTest::setupTestField in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setupTestField()
  2. 9 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|\PHPUnit\Framework\MockObject\MockObject The test field.

11 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::testRenderAsExternalLinkWithPathAndTokens in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
Tests rendering of a link with a path and options.

... See full list

File

core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php, line 653
Contains \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest.

Class

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

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

protected function setupTestField(array $options = []) {

  /** @var \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTestField $field */
  $field = $this
    ->getMockBuilder('Drupal\\Tests\\views\\Unit\\Plugin\\field\\FieldPluginBaseTestField')
    ->addMethods([
    'l',
  ])
    ->setConstructorArgs([
    $this->configuration,
    $this->pluginId,
    $this->pluginDefinition,
  ])
    ->getMock();
  $field
    ->init($this->executable, $this->display, $options);
  $field
    ->setLinkGenerator($this->linkGenerator);
  return $field;
}