From ca81e9907d726b201d7aa5604ea046099d1088a3 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Tue, 23 Jun 2015 20:51:21 -0500 Subject: [PATCH] Issue #2504995 by Xano: Component DefaultFactory relies on core's concept of plugin providers --- core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php | 2 +- core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php | 2 +- .../tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php b/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php index 2315a7f6ba78..3362654ba1a6 100644 --- a/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php +++ b/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php @@ -88,7 +88,7 @@ public static function getPluginClass($plugin_id, $plugin_definition = NULL, $re } if ($required_interface && !is_subclass_of($plugin_definition['class'], $required_interface)) { - throw new PluginException(sprintf('Plugin "%s" (%s) in %s should implement interface %s.', $plugin_id, $plugin_definition['class'], $plugin_definition['provider'], $required_interface)); + throw new PluginException(sprintf('Plugin "%s" (%s) must implement interface %s.', $plugin_id, $plugin_definition['class'], $required_interface)); } return $class; diff --git a/core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php b/core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php index 8d840d1a6f83..a23b69049c3a 100644 --- a/core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php +++ b/core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php @@ -60,7 +60,7 @@ public function testGetPluginClassWithInterface() { * Tests getPluginClass() with a required interface but no implementation. * * @expectedException \Drupal\Component\Plugin\Exception\PluginException - * @expectedExceptionMessage Plugin "cherry" (Drupal\plugin_test\Plugin\plugin_test\fruit\Kale) in core should implement interface \Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface. + * @expectedExceptionMessage Plugin "cherry" (Drupal\plugin_test\Plugin\plugin_test\fruit\Kale) must implement interface \Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface. */ public function testGetPluginClassWithInterfaceAndInvalidClass() { $plugin_class = 'Drupal\plugin_test\Plugin\plugin_test\fruit\Kale'; diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php index 350359714911..d2944001e107 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php @@ -251,7 +251,7 @@ public function testCreateInstanceWithJustValidInterfaces() { * @covers ::createInstance * * @expectedException \Drupal\Component\Plugin\Exception\PluginException - * @expectedExceptionMessage Plugin "kale" (Drupal\plugin_test\Plugin\plugin_test\fruit\Kale) in plugin_test should implement interface \Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface + * @expectedExceptionMessage Plugin "kale" (Drupal\plugin_test\Plugin\plugin_test\fruit\Kale) must implement interface \Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface */ public function testCreateInstanceWithInvalidInterfaces() { $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); -- GitLab