function ContextAwarePluginTraitTest::testGetContextValue

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php \Drupal\KernelTests\Core\Plugin\Context\ContextAwarePluginTraitTest::testGetContextValue()
  2. 11.x core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php \Drupal\KernelTests\Core\Plugin\Context\ContextAwarePluginTraitTest::testGetContextValue()

@covers ::getContextValue

File

core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php, line 76

Class

ContextAwarePluginTraitTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Plugin%21ContextAwarePluginTrait.php/trait/ContextAwarePluginTrait/9" title="Provides a trait to add context-aware functionality to plugins." class="local">\Drupal\Core\Plugin\ContextAwarePluginTrait</a>

Namespace

Drupal\KernelTests\Core\Plugin\Context

Code

public function testGetContextValue() {
    $this->plugin
        ->setContextValue('nato_letter', 'Alpha');
    $this->assertSame('Alpha', $this->plugin
        ->getContextValue('nato_letter'));
}

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