comparison core/tests/Drupal/Tests/Component/Plugin/StubFallbackPluginManager.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Tests\Component\Plugin;
4
5 use Drupal\Component\Plugin\FallbackPluginManagerInterface;
6 use Drupal\Component\Plugin\PluginManagerBase;
7
8 /**
9 * Stubs \Drupal\Component\Plugin\FallbackPluginManagerInterface.
10 *
11 * We have to stub \Drupal\Component\Plugin\FallbackPluginManagerInterface for
12 * \Drupal\Tests\Component\Plugin\PluginManagerBaseTest so that we can
13 * implement ::getFallbackPluginId().
14 *
15 * We do this so we can have it just return the plugin ID passed to it, with
16 * '_fallback' appended.
17 */
18 class StubFallbackPluginManager extends PluginManagerBase implements FallbackPluginManagerInterface {
19
20 /**
21 * {@inheritdoc}
22 */
23 public function getFallbackPluginId($plugin_id, array $configuration = []) {
24 // Minimally implement getFallbackPluginId so that we can test it.
25 return $plugin_id . '_fallback';
26 }
27
28 }