You are here

public function ContextTest::testSetContextValueTypedData in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php \Drupal\Tests\Core\Plugin\Context\ContextTest::testSetContextValueTypedData()

@covers ::setContextValue

File

core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php, line 91
Contains \Drupal\Tests\Core\Plugin\Context\ContextTest.

Class

ContextTest
@coversDefaultClass \Drupal\Core\Plugin\Context\Context @group Plugin

Namespace

Drupal\Tests\Core\Plugin\Context

Code

public function testSetContextValueTypedData() {
  $this->contextDefinition = $this
    ->getMockBuilder('Drupal\\Core\\Plugin\\Context\\ContextDefinitionInterface')
    ->setMethods(array(
    'getDefaultValue',
    'getDataDefinition',
  ))
    ->getMockForAbstractClass();
  $typed_data = $this
    ->getMock('Drupal\\Core\\TypedData\\TypedDataInterface');
  $context = new Context($this->contextDefinition, $typed_data);
  $this
    ->assertSame($typed_data, $context
    ->getContextData());
}