annotate core/tests/Drupal/Tests/Component/Plugin/StubFallbackPluginManager.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Tests\Component\Plugin;
Chris@0 4
Chris@0 5 use Drupal\Component\Plugin\FallbackPluginManagerInterface;
Chris@0 6 use Drupal\Component\Plugin\PluginManagerBase;
Chris@0 7
Chris@0 8 /**
Chris@0 9 * Stubs \Drupal\Component\Plugin\FallbackPluginManagerInterface.
Chris@0 10 *
Chris@0 11 * We have to stub \Drupal\Component\Plugin\FallbackPluginManagerInterface for
Chris@0 12 * \Drupal\Tests\Component\Plugin\PluginManagerBaseTest so that we can
Chris@0 13 * implement ::getFallbackPluginId().
Chris@0 14 *
Chris@0 15 * We do this so we can have it just return the plugin ID passed to it, with
Chris@0 16 * '_fallback' appended.
Chris@0 17 */
Chris@0 18 class StubFallbackPluginManager extends PluginManagerBase implements FallbackPluginManagerInterface {
Chris@0 19
Chris@0 20 /**
Chris@0 21 * {@inheritdoc}
Chris@0 22 */
Chris@0 23 public function getFallbackPluginId($plugin_id, array $configuration = []) {
Chris@0 24 // Minimally implement getFallbackPluginId so that we can test it.
Chris@0 25 return $plugin_id . '_fallback';
Chris@0 26 }
Chris@0 27
Chris@0 28 }