You are here

public function DisplayVariantTest::setUpDisplayVariant in Zircon Profile 8.0

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 30
Contains \Drupal\Tests\Core\Display\DisplayVariantTest.

Class

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

Namespace

Drupal\Tests\Core\Display

Code

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