diff --git a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Controller/PluginTest.php b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Controller/PluginTest.php new file mode 100644 index 0000000..b4e1116 --- /dev/null +++ b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Controller/PluginTest.php @@ -0,0 +1,32 @@ +getDefinitions() as $plugin_id => $definition) { + $output[$plugin_id] = array( + '#markup' => $definition['label'], + ); + } + return $output; + } +} diff --git a/core/modules/system/tests/modules/plugin_test/plugin_test.module b/core/modules/system/tests/modules/plugin_test/plugin_test.module index 27fc614..8dd0c6f 100644 --- a/core/modules/system/tests/modules/plugin_test/plugin_test.module +++ b/core/modules/system/tests/modules/plugin_test/plugin_test.module @@ -1,7 +1,5 @@ TRUE, - 'page callback' => 'plugin_test_definitions', + 'route_name' => 'plugin_test_definitions', ); return $items; } - -/** - * A simple page callback that prints plugin labels for testing. - * - * @return array - * A simple renderable array of plugin labels. - */ -function plugin_test_definitions() { - $manager = new CachedMockBlockManager(); - $output = array(); - foreach($manager->getDefinitions() as $plugin_id => $definition) { - $output[$plugin_id] = array( - '#markup' => $definition['label'], - ); - } - return $output; -} diff --git a/core/modules/system/tests/modules/plugin_test/plugin_test.routing.yml b/core/modules/system/tests/modules/plugin_test/plugin_test.routing.yml new file mode 100644 index 0000000..16f05a9 --- /dev/null +++ b/core/modules/system/tests/modules/plugin_test/plugin_test.routing.yml @@ -0,0 +1,6 @@ +plugin_definition_test: + pattern: '/plugin_definition_test' + defaults: + _content: '\Drupal\plugin_test\Controller\PluginTest::testDefinitions' + requirements: + _access: 'TRUE'