function ContextTest::testSetContextValueTypedData

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php \Drupal\Tests\Core\Plugin\Context\ContextTest::testSetContextValueTypedData()
  2. 10 core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php \Drupal\Tests\Core\Plugin\Context\ContextTest::testSetContextValueTypedData()
  3. 11.x 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 89

Class

ContextTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Plugin%21Context%21Context.php/class/Context/8.9.x" title="A Drupal specific context wrapper class." class="local">\Drupal\Core\Plugin\Context\Context</a> @group Plugin

Namespace

Drupal\Tests\Core\Plugin\Context

Code

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

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