function DisplayVariantTest::setUpDisplayVariant

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php \Drupal\Tests\Core\Display\DisplayVariantTest::setUpDisplayVariant()
  2. 10 core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php \Drupal\Tests\Core\Display\DisplayVariantTest::setUpDisplayVariant()
  3. 11.x core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php \Drupal\Tests\Core\Display\DisplayVariantTest::setUpDisplayVariant()

Sets up a display variant plugin for testing.

Parameters

array $configuration: An array of plugin configuration.

array $definition: The plugin definition array.

Return value

\Drupal\Core\Display\VariantBase|\PHPUnit\Framework\MockObject\MockObject A mocked display variant plugin.

7 calls to DisplayVariantTest::setUpDisplayVariant()
DisplayVariantTest::testAccess in core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
Tests the access() method.
DisplayVariantTest::testGetConfiguration in core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
Tests the getConfiguration() method.
DisplayVariantTest::testGetWeight in core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
Tests the getWeight() method.
DisplayVariantTest::testGetWeightDefault in core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
Tests the getWeight() method using a default value.
DisplayVariantTest::testLabel in core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
Tests the label() method.

... See full list

File

core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php, line 25

Class

DisplayVariantTest
@coversDefaultClass \Drupal\Core\Display\VariantBase @group Display

Namespace

Drupal\Tests\Core\Display

Code

public function setUpDisplayVariant($configuration = [], $definition = []) {
    return $this->getMockBuilder('Drupal\\Core\\Display\\VariantBase')
        ->setConstructorArgs([
        $configuration,
        'test',
        $definition,
    ])
        ->setMethods([
        'build',
    ])
        ->getMock();
}

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