function ContextAwarePluginTraitTest::testConfigurableGetContextValueFromConfiguration

@covers ::getContextValue @group legacy

File

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

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 testConfigurableGetContextValueFromConfiguration() {
    $this->expectDeprecation('Passing context values to plugins via configuration is deprecated in drupal:9.1.0 and will be removed before drupal:10.0.0. Instead, call ::setContextValue() on the plugin itself. See https://www.drupal.org/node/3120980');
    // Assert that the context value passed in the plugin configuration is
    // available.
    $this->assertSame('Alpha', $this->configurablePlugin
        ->getContextValue('nato_letter'));
}

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