diff --git a/core/modules/system/src/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php b/core/modules/system/src/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php index 6cca8f5..76f5aeb 100644 --- a/core/modules/system/src/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php +++ b/core/modules/system/src/Tests/Plugin/Discovery/AnnotatedClassDiscoveryTest.php @@ -57,12 +57,21 @@ protected function setUp() { 'class' => 'Drupal\plugin_test\Plugin\plugin_test\fruit\Orange', 'provider' => 'plugin_test', ), + 'big_apple' => array( + 'id' => 'big_apple', + 'label' => 'Big Apple', + 'color' => 'green', + 'class' => 'Drupal\plugin_test_extra\Plugin\plugin_test\fruit\BigApple', + 'provider' => 'plugin_test_extra', + ), ); $base_directory = \Drupal::root() . '/core/modules/system/tests/modules/plugin_test/src'; - $namespaces = new \ArrayObject(array('Drupal\plugin_test' => $base_directory)); + $base_directory2 = \Drupal::root() . '/core/modules/system/tests/modules/plugin_test_extra/src'; + $namespaces = new \ArrayObject(array('Drupal\plugin_test' => $base_directory, 'Drupal\plugin_test_extra' => $base_directory2)); - $this->discovery = new AnnotatedClassDiscovery('Plugin/plugin_test/fruit', $namespaces); + $annotation_namespaces = ['Drupal\plugin_test\Plugin\Annotation', 'Drupal\plugin_test_extra\Plugin\Annotation']; + $this->discovery = new AnnotatedClassDiscovery('Plugin/plugin_test/fruit', $namespaces, 'Drupal\Component\Annotation\Plugin', $annotation_namespaces); $this->emptyDiscovery = new AnnotatedClassDiscovery('Plugin/non_existing_module/non_existing_plugin_type', $namespaces); } diff --git a/core/modules/system/tests/modules/plugin_test_extra/plugin_test_extra.info.yml b/core/modules/system/tests/modules/plugin_test_extra/plugin_test_extra.info.yml index e69de29..c8bf6cb 100644 --- a/core/modules/system/tests/modules/plugin_test_extra/plugin_test_extra.info.yml +++ b/core/modules/system/tests/modules/plugin_test_extra/plugin_test_extra.info.yml @@ -0,0 +1,6 @@ +name: 'Plugin Test Extra' +type: module +description: 'Test that plugins can provide plugins and provide namespace discovery for plugin test implementations.' +package: Testing +version: VERSION +core: 8.x diff --git a/core/modules/system/tests/modules/plugin_test_extra/src/Plugin/Annotation/PluginExampleExtended.php b/core/modules/system/tests/modules/plugin_test_extra/src/Plugin/Annotation/PluginExampleExtended.php index e69de29..0cada97 100644 --- a/core/modules/system/tests/modules/plugin_test_extra/src/Plugin/Annotation/PluginExampleExtended.php +++ b/core/modules/system/tests/modules/plugin_test_extra/src/Plugin/Annotation/PluginExampleExtended.php @@ -0,0 +1,19 @@ +