projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website]
/
web
/
core
/
modules
/
system
/
tests
/
modules
/
plugin_test
/
src
/
Plugin
/
MockBlockManager.php
diff --git
a/web/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php
b/web/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php
index 443ab5d04090ca8f1e96cd672910b03f2ce49f21..de9fc3364d8e7ba461fa80eda63f10e04105b939 100644
(file)
--- a/
web/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php
+++ b/
web/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php
@@
-7,11
+7,13
@@
use Drupal\Component\Plugin\Discovery\StaticDiscovery;
use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator;
use Drupal\Component\Plugin\Factory\ReflectionFactory;
use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator;
use Drupal\Component\Plugin\Factory\ReflectionFactory;
use Drupal\Core\Plugin\Context\ContextDefinition;
+use Drupal\Core\Plugin\Context\EntityContextDefinition;
/**
* Defines a plugin manager used by Plugin API derivative unit tests.
*/
class MockBlockManager extends PluginManagerBase {
/**
* Defines a plugin manager used by Plugin API derivative unit tests.
*/
class MockBlockManager extends PluginManagerBase {
+
public function __construct() {
// Create the object that can be used to return definitions for all the
public function __construct() {
// Create the object that can be used to return definitions for all the
@@
-139,7
+141,11
@@
class MockBlockManager extends PluginManagerBase {
// a TranslatableMarkup and we will do assertEqual() checks on arrays that
// include ContextDefinition objects, and var_export() has problems
// printing TranslatableMarkup objects.
// 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);
+ $class = ContextDefinition::class;
+ if (strpos($data_type, 'entity:') === 0) {
+ $class = EntityContextDefinition::class;
+ }
+ return new $class($data_type, (string) $label, $required);
}
}
}
}