function ContextAwarePluginTraitTest::testConfigurableGetContextValueFromConfiguration
@covers ::getContextValue @group legacy
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Plugin/ Context/ ContextAwarePluginTraitTest.php, line 102
Class
- ContextAwarePluginTraitTest
- @coversDefaultClass \Drupal\Core\Plugin\ContextAwarePluginTrait
Namespace
Drupal\KernelTests\Core\Plugin\ContextCode
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.