You are here

public function DisplayVariantTest::setUpDisplayVariant in Drupal 9

Same name and namespace in other branches
  1. 8 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();
}