function ContextTypedDataTest::testHasContextValue
Same name and namespace in other branches
- 10 core/tests/Drupal/KernelTests/Core/Plugin/ContextTypedDataTest.php \Drupal\KernelTests\Core\Plugin\ContextTypedDataTest::testHasContextValue()
- 11.x core/tests/Drupal/KernelTests/Core/Plugin/ContextTypedDataTest.php \Drupal\KernelTests\Core\Plugin\ContextTypedDataTest::testHasContextValue()
@covers ::hasContextValue
@dataProvider providerHasContextValue
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Plugin/ ContextTypedDataTest.php, line 84
Class
- ContextTypedDataTest
- Tests that contexts work properly with the typed data manager.
Namespace
Drupal\KernelTests\Core\PluginCode
public function testHasContextValue($has_context_value, $default_value) : void {
$definition = new ContextDefinition('any');
$definition->setDefaultValue($default_value);
$context = new Context($definition);
$this->assertSame($has_context_value, $context->hasContextValue());
$this->assertSame($default_value, $context->getContextValue());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.