function FieldPluginBaseTest::setupTestField

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setupTestField()
  2. 10 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setupTestField()
  3. 11.x 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

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;
}

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