You are here

protected function FieldPluginBaseTest::setupTestField in Zircon Profile 8.0

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()

Sets up a test field.

Return value

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

8 calls to FieldPluginBaseTest::setupTestField()
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::testRenderAsLinkWithoutPath in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
Test rendering as a link without a path.
FieldPluginBaseTest::testRenderAsLinkWithPathAndOptions in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
Test rendering of a link with a path and options.

... See full list

File

core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php, line 541
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
    ->getMock('Drupal\\Tests\\views\\Unit\\Plugin\\field\\FieldPluginBaseTestField', [
    'l',
  ], [
    $this->configuration,
    $this->pluginId,
    $this->pluginDefinition,
  ]);
  $field
    ->init($this->executable, $this->display, $options);
  $field
    ->setLinkGenerator($this->linkGenerator);
  return $field;
}