view core/tests/Drupal/Tests/Component/Plugin/StubFallbackPluginManager.php @ 3:e11175134f4e

Attempt to introduce editable version of theme
author Chris Cannam
date Tue, 05 Dec 2017 11:25:38 +0000
parents 4c8ae668cc8c
children
line wrap: on
line source
<?php

namespace Drupal\Tests\Component\Plugin;

use Drupal\Component\Plugin\FallbackPluginManagerInterface;
use Drupal\Component\Plugin\PluginManagerBase;

/**
 * Stubs \Drupal\Component\Plugin\FallbackPluginManagerInterface.
 *
 * We have to stub \Drupal\Component\Plugin\FallbackPluginManagerInterface for
 * \Drupal\Tests\Component\Plugin\PluginManagerBaseTest so that we can
 * implement ::getFallbackPluginId().
 *
 * We do this so we can have it just return the plugin ID passed to it, with
 * '_fallback' appended.
 */
class StubFallbackPluginManager extends PluginManagerBase implements FallbackPluginManagerInterface {

  /**
   * {@inheritdoc}
   */
  public function getFallbackPluginId($plugin_id, array $configuration = []) {
    // Minimally implement getFallbackPluginId so that we can test it.
    return $plugin_id . '_fallback';
  }

}