protected function MockBlockManager::createContextDefinition in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php \Drupal\plugin_test\Plugin\MockBlockManager::createContextDefinition()
Creates a new context definition with a label that is cast to string.
Parameters
string $data_type: The required data type.
mixed string|null $label: The label of this context definition for the UI.
bool $required: Whether the context definition is required.
Return value
\Drupal\Core\Plugin\Context\ContextDefinition
1 call to MockBlockManager::createContextDefinition()
- MockBlockManager::__construct in core/
modules/ system/ tests/ modules/ plugin_test/ src/ Plugin/ MockBlockManager.php
File
- core/
modules/ system/ tests/ modules/ plugin_test/ src/ Plugin/ MockBlockManager.php, line 134 - Contains \Drupal\plugin_test\Plugin\MockBlockManager.
Class
- MockBlockManager
- Defines a plugin manager used by Plugin API derivative unit tests.
Namespace
Drupal\plugin_test\PluginCode
protected function createContextDefinition($data_type, $label, $required = TRUE) {
// We cast the label to string for testing purposes only, as it may be
// a TranslatableMarkup and we will do assertEqual() checks on arrays that
// include ContextDefinition objects, and var_export() has problems
// printing TranslatableMarkup objects.
return new ContextDefinition($data_type, (string) $label, $required);
}