diff --git a/core/lib/Drupal/Core/Layout/DerivablePluginDefinitionInterface.php b/core/lib/Drupal/Core/Layout/DerivablePluginDefinitionInterface.php deleted file mode 100644 index 3d24b9d..0000000 --- a/core/lib/Drupal/Core/Layout/DerivablePluginDefinitionInterface.php +++ /dev/null @@ -1,42 +0,0 @@ -subdir, $this->namespaces, $this->pluginDefinitionAnnotationName, $this->additionalAnnotationNamespaces); $discovery = new YamlDiscoveryDecorator($discovery, 'layouts', $this->moduleHandler->getModuleDirectories() + $this->themeHandler->getThemeDirectories()); $discovery = new ObjectDefinitionDiscoveryDecorator($discovery, $this->pluginDefinitionAnnotationName); - $discovery = new ObjectDefinitionContainerDerivativeDiscoveryDecorator($discovery); + $discovery = new DerivativeDiscoveryDecorator($discovery); $this->discovery = $discovery; } return $this->discovery; diff --git a/core/lib/Drupal/Core/Layout/ObjectDefinitionContainerDerivativeDiscoveryDecorator.php b/core/lib/Drupal/Core/Layout/ObjectDefinitionContainerDerivativeDiscoveryDecorator.php deleted file mode 100644 index 02ecfb0..0000000 --- a/core/lib/Drupal/Core/Layout/ObjectDefinitionContainerDerivativeDiscoveryDecorator.php +++ /dev/null @@ -1,37 +0,0 @@ -getDeriver()) { - if (!class_exists($class)) { - throw new InvalidDeriverException(sprintf('Plugin (%s) deriver "%s" does not exist.', $base_definition['id'], $class)); - } - if (!is_subclass_of($class, '\Drupal\Component\Plugin\Derivative\DeriverInterface')) { - throw new InvalidDeriverException(sprintf('Plugin (%s) deriver "%s" must implement \Drupal\Component\Plugin\Derivative\DeriverInterface.', $base_definition['id'], $class)); - } - } - return $class; - } - -} diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php index d472352..a243f35 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php @@ -9,6 +9,8 @@ /** * Unit tests for the derivative discovery decorator. * + * @coversDefaultClass \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator + * * @group Plugin */ class DerivativeDiscoveryDecoratorTest extends UnitTestCase { @@ -84,9 +86,11 @@ public function testGetDerivativeFetcherWithAnnotationObjects() { } /** - * Tests the getDerivativeFetcher method with classed objects instead of arrays. + * Tests getDeriverClass with classed objects instead of arrays. + * + * @covers ::getDeriverClass */ - public function testGetDerivativeFetcherWithClassedDefinitions() { + public function testGetDeriverClassWithClassedDefinitions() { $definitions = array(); $definition = $this->prophesize(DerivablePluginDefinitionInterface::class); $definition->getDeriver()->willReturn(TestDerivativeDiscoveryWithObject::class);