Commit e6f953db authored by webchick's avatar webchick

Issue #1875182 by yched: Pass plugin definition to plugin instances instead of discovery object.

parent 1bec7630
......@@ -36,13 +36,13 @@ abstract class ContextAwarePluginBase extends PluginBase implements ContextAware
* initialize the defined contexts by setting it to an array of context
* values keyed by context names.
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
$context = array();
if (isset($configuration['context'])) {
$context = $configuration['context'];
unset($configuration['context']);
}
parent::__construct($configuration, $plugin_id, $discovery);
parent::__construct($configuration, $plugin_id, $plugin_definition);
foreach ($context as $key => $value) {
$context_definition = $this->getContextDefinition($key);
$this->context[$key] = new Context($context_definition);
......
......@@ -41,23 +41,23 @@ public function __construct(DiscoveryInterface $discovery) {
* Implements Drupal\Component\Plugin\Factory\FactoryInterface::createInstance().
*/
public function createInstance($plugin_id, array $configuration) {
$plugin_class = static::getPluginClass($plugin_id, $this->discovery);
return new $plugin_class($configuration, $plugin_id, $this->discovery);
$plugin_definition = $this->discovery->getDefinition($plugin_id);
$plugin_class = static::getPluginClass($plugin_id, $plugin_definition);
return new $plugin_class($configuration, $plugin_id, $plugin_definition);
}
/**
* Finds the class relevant for a given plugin.
*
* @param array $plugin_id
* The id of a plugin.
* @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery
* The discovery object.
* @param string $plugin_id
* The id of a plugin.
* @param array $plugin_definition
* The plugin definition associated to the plugin_id.
*
* @return string
* The appropriate class name.
* @return string
* The appropriate class name.
*/
public static function getPluginClass($plugin_id, DiscoveryInterface $discovery) {
$plugin_definition = $discovery->getDefinition($plugin_id);
public static function getPluginClass($plugin_id, array $plugin_definition = NULL) {
if (empty($plugin_definition['class'])) {
throw new PluginException(sprintf('The plugin (%s) did not specify an instance class.', $plugin_id));
}
......
......@@ -6,8 +6,6 @@
namespace Drupal\Component\Plugin\Factory;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
/**
* Factory interface implemented by all plugin factories.
*/
......
......@@ -20,13 +20,14 @@ class ReflectionFactory extends DefaultFactory {
* Implements Drupal\Component\Plugin\Factory\FactoryInterface::createInstance().
*/
public function createInstance($plugin_id, array $configuration) {
$plugin_class = static::getPluginClass($plugin_id, $this->discovery);
$plugin_definition = $this->discovery->getDefinition($plugin_id);
$plugin_class = static::getPluginClass($plugin_id, $plugin_definition);
// Lets figure out of there's a constructor for this class and pull
// arguments from the $options array if so to populate it.
$reflector = new ReflectionClass($plugin_class);
if ($reflector->hasMethod('__construct')) {
$arguments = $this->getInstanceArguments($reflector, $plugin_id, $configuration);
$arguments = $this->getInstanceArguments($reflector, $plugin_id, $plugin_definition, $configuration);
$instance = $reflector->newInstanceArgs($arguments);
}
else {
......@@ -46,28 +47,29 @@ public function createInstance($plugin_id, array $configuration) {
* The reflector object being used to inspect the plugin class.
* @param string $plugin_id
* The identifier of the plugin implementation.
* @param array $plugin_definition
* The definition associated to the plugin_id.
* @param array $configuration
* An array of configuration that may be passed to the instance.
*
* @return array
* An array of arguments to be passed to the constructor.
*/
protected function getInstanceArguments(ReflectionClass $reflector, $plugin_id, array $configuration) {
protected function getInstanceArguments(ReflectionClass $reflector, $plugin_id, array $plugin_definition, array $configuration) {
$arguments = array();
foreach ($reflector->getMethod('__construct')->getParameters() as $param) {
$param_name = $param->getName();
$param_class = $param->getClass();
if ($param_name == 'plugin_id') {
$arguments[] = $plugin_id;
}
elseif ($param_name == 'plugin_definition') {
$arguments[] = $plugin_definition;
}
elseif ($param_name == 'configuration') {
$arguments[] = $configuration;
}
elseif ($param_class && $param_class->isInstance($this->discovery)) {
$arguments[] = $this->discovery;
}
elseif (isset($configuration[$param_name]) || array_key_exists($param_name, $configuration)) {
$arguments[] = $configuration[$param_name];
}
......
......@@ -6,26 +6,24 @@
namespace Drupal\Component\Plugin;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
/**
* Base class for plugins wishing to support metadata inspection.
*/
abstract class PluginBase implements PluginInspectionInterface {
/**
* The discovery object.
* The plugin_id.
*
* @var Drupal\Component\Plugin\Discovery\DiscoveryInterface
* @var string
*/
protected $discovery;
protected $pluginId;
/**
* The plugin_id.
* The plugin implementation definition.
*
* @var string
* @var array
*/
protected $plugin_id;
protected $pluginDefinition;
/**
* Configuration information passed into the plugin.
......@@ -41,28 +39,27 @@ abstract class PluginBase implements PluginInspectionInterface {
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param DiscoveryInterface $discovery
* The Discovery class that holds access to the plugin implementation
* definition.
* @param array $plugin_definition
* The plugin implementation definition.
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
$this->configuration = $configuration;
$this->plugin_id = $plugin_id;
$this->discovery = $discovery;
$this->pluginId = $plugin_id;
$this->pluginDefinition = $plugin_definition;
}
/**
* Implements Drupal\Component\Plugin\PluginInterface::getPluginId().
*/
public function getPluginId() {
return $this->plugin_id;
return $this->pluginId;
}
/**
* Implements Drupal\Component\Plugin\PluginInterface::getDefinition().
*/
public function getDefinition() {
return $this->discovery->getDefinition($this->plugin_id);
return $this->pluginDefinition;
}
// Note: Plugin configuration is optional so its left to the plugin type to
......
......@@ -24,13 +24,13 @@ abstract class ContextAwarePluginBase extends PluginBase {
/**
* Override of \Drupal\Component\Plugin\ContextAwarePluginBase::__construct().
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
$context = array();
if (isset($configuration['context'])) {
$context = $configuration['context'];
unset($configuration['context']);
}
parent::__construct($configuration, $plugin_id, $discovery);
parent::__construct($configuration, $plugin_id, $plugin_definition);
foreach ($context as $key => $value) {
$context_definition = $this->getContextDefinition($key);
$this->context[$key] = new Context($context_definition);
......
......@@ -30,8 +30,8 @@ abstract class BlockBase extends PluginBase implements BlockInterface {
/**
* Overrides \Drupal\Component\Plugin\PluginBase::__construct().
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery, Block $entity) {
parent::__construct($configuration, $plugin_id, $discovery);
public function __construct(array $configuration, $plugin_id, array $plugin_definition, Block $entity) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entity = $entity;
}
......
......@@ -41,8 +41,9 @@ public function __construct(array $namespaces) {
* Overrides \Drupal\Component\Plugin\PluginManagerBase::createInstance().
*/
public function createInstance($plugin_id, array $configuration = array(), Block $entity = NULL) {
$plugin_class = DefaultFactory::getPluginClass($plugin_id, $this->discovery);
return new $plugin_class($configuration, $plugin_id, $this->discovery, $entity);
$plugin_definition = $this->discovery->getDefinition($plugin_id);
$plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition);
return new $plugin_class($configuration, $plugin_id, $plugin_definition, $entity);
}
}
......@@ -40,9 +40,8 @@ class DateTimeDatelistWidget extends WidgetBase {
*
* @param array $plugin_id
* The plugin_id for the widget.
* @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery
* The Discovery class that holds access to the widget implementation
* definition.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\field\FieldInstance $instance
* The field instance to which the widget is associated.
* @param array $settings
......@@ -50,10 +49,10 @@ class DateTimeDatelistWidget extends WidgetBase {
* @param int $weight
* The widget weight.
*/
public function __construct($plugin_id, DiscoveryInterface $discovery, FieldInstance $instance, array $settings, $weight) {
public function __construct($plugin_id, array $plugin_definition, FieldInstance $instance, array $settings, $weight) {
// Identify the function used to set the default value.
$instance['default_value_function'] = $this->defaultValueFunction();
parent::__construct($plugin_id, $discovery, $instance, $settings, $weight);
parent::__construct($plugin_id, $plugin_definition, $instance, $settings, $weight);
}
/**
......
......@@ -34,9 +34,8 @@ class DateTimeDefaultWidget extends WidgetBase {
*
* @param array $plugin_id
* The plugin_id for the widget.
* @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery
* The Discovery class that holds access to the widget implementation
* definition.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\field\FieldInstance $instance
* The field instance to which the widget is associated.
* @param array $settings
......@@ -44,10 +43,10 @@ class DateTimeDefaultWidget extends WidgetBase {
* @param int $weight
* The widget weight.
*/
public function __construct($plugin_id, DiscoveryInterface $discovery, FieldInstance $instance, array $settings, $weight) {
public function __construct($plugin_id, array $plugin_definition, FieldInstance $instance, array $settings, $weight) {
// Identify the function used to set the default value.
$instance['default_value_function'] = $this->defaultValueFunction();
parent::__construct($plugin_id, $discovery, $instance, $settings, $weight);
parent::__construct($plugin_id, $plugin_definition, $instance, $settings, $weight);
}
/**
......
......@@ -7,7 +7,6 @@
namespace Drupal\field\Plugin\Type\Formatter;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\field\Plugin\PluginSettingsBase;
use Drupal\field\FieldInstance;
......@@ -57,9 +56,8 @@ abstract class FormatterBase extends PluginSettingsBase implements FormatterInte
*
* @param string $plugin_id
* The plugin_id for the formatter.
* @param Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery
* The Discovery class that holds access to the formatter implementation
* definition.
* @param array $plugin_definition
* The plugin implementation definition.
* @param Drupal\field\FieldInstance $instance
* The field instance to which the formatter is associated.
* @param array $settings
......@@ -69,8 +67,8 @@ abstract class FormatterBase extends PluginSettingsBase implements FormatterInte
* @param string $view_mode
* The view mode.
*/
public function __construct($plugin_id, DiscoveryInterface $discovery, $instance, array $settings, $label, $view_mode) {
parent::__construct(array(), $plugin_id, $discovery);
public function __construct($plugin_id, array $plugin_definition, $instance, array $settings, $label, $view_mode) {
parent::__construct(array(), $plugin_id, $plugin_definition);
$this->instance = $instance;
$this->field = field_info_field($instance['field_name']);
......
......@@ -18,7 +18,8 @@ class FormatterFactory extends DefaultFactory {
* Overrides Drupal\Component\Plugin\Factory\DefaultFactory::createInstance().
*/
public function createInstance($plugin_id, array $configuration) {
$plugin_class = static::getPluginClass($plugin_id, $this->discovery);
return new $plugin_class($plugin_id, $this->discovery, $configuration['instance'], $configuration['settings'], $configuration['label'], $configuration['view_mode']);
$plugin_definition = $this->discovery->getDefinition($plugin_id);
$plugin_class = static::getPluginClass($plugin_id, $plugin_definition);
return new $plugin_class($plugin_id, $plugin_definition, $configuration['instance'], $configuration['settings'], $configuration['label'], $configuration['view_mode']);
}
}
......@@ -7,7 +7,6 @@
namespace Drupal\field\Plugin\Type\Widget;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Entity\EntityInterface;
use Drupal\field\Plugin\PluginSettingsBase;
......@@ -51,9 +50,8 @@ abstract class WidgetBase extends PluginSettingsBase implements WidgetInterface
*
* @param array $plugin_id
* The plugin_id for the widget.
* @param Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery
* The Discovery class that holds access to the widget implementation
* definition.
* @param array $plugin_definition
* The plugin implementation definition.
* @param Drupal\field\FieldInstance $instance
* The field instance to which the widget is associated.
* @param array $settings
......@@ -61,8 +59,8 @@ abstract class WidgetBase extends PluginSettingsBase implements WidgetInterface
* @param int $weight
* The widget weight.
*/
public function __construct($plugin_id, DiscoveryInterface $discovery, FieldInstance $instance, array $settings, $weight) {
parent::__construct(array(), $plugin_id, $discovery);
public function __construct($plugin_id, array $plugin_definition, FieldInstance $instance, array $settings, $weight) {
parent::__construct(array(), $plugin_id, $plugin_definition);
$this->instance = $instance;
$this->field = field_info_field($instance['field_name']);
......
......@@ -18,7 +18,8 @@ class WidgetFactory extends DefaultFactory {
* Overrides Drupal\Component\Plugin\Factory\DefaultFactory::createInstance().
*/
public function createInstance($plugin_id, array $configuration) {
$plugin_class = static::getPluginClass($plugin_id, $this->discovery);
return new $plugin_class($plugin_id, $this->discovery, $configuration['instance'], $configuration['settings'], $configuration['weight']);
$plugin_definition = $this->discovery->getDefinition($plugin_id);
$plugin_class = static::getPluginClass($plugin_id, $plugin_definition);
return new $plugin_class($plugin_id, $plugin_definition, $configuration['instance'], $configuration['settings'], $configuration['weight']);
}
}
......@@ -7,7 +7,6 @@
namespace Drupal\layout\Plugin\layout\layout;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\layout\Plugin\LayoutInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Annotation\Plugin;
......@@ -23,15 +22,13 @@ class StaticLayout extends PluginBase implements LayoutInterface {
/**
* Overrides Drupal\Component\Plugin\PluginBase::__construct().
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
// Get definition by discovering the declarative information.
$definition = $discovery->getDefinition($plugin_id);
foreach ($definition['regions'] as $region => $title) {
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
foreach ($plugin_definition['regions'] as $region => $title) {
if (!isset($configuration['regions'][$region])) {
$configuration['regions'][$region] = array();
}
}
parent::__construct($configuration, $plugin_id, $discovery);
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
/**
......
......@@ -28,7 +28,7 @@ public function permissions() {
$definition = $this->getDefinition();
foreach ($this->availableMethods() as $method) {
$lowered_method = strtolower($method);
$permissions["restful $lowered_method $this->plugin_id"] = array(
$permissions["restful $lowered_method $this->pluginId"] = array(
'title' => t('Access @method on %label resource', array('@method' => $method, '%label' => $definition['label'])),
);
}
......@@ -40,8 +40,8 @@ public function permissions() {
*/
public function routes() {
$collection = new RouteCollection();
$path_prefix = strtr($this->plugin_id, ':', '/');
$route_name = strtr($this->plugin_id, ':', '.');
$path_prefix = strtr($this->pluginId, ':', '/');
$route_name = strtr($this->pluginId, ':', '.');
$methods = $this->availableMethods();
foreach ($methods as $method) {
......@@ -49,11 +49,11 @@ public function routes() {
$route = new Route("/$path_prefix/{id}", array(
'_controller' => 'Drupal\rest\RequestHandler::handle',
// Pass the resource plugin ID along as default property.
'_plugin' => $this->plugin_id,
'_plugin' => $this->pluginId,
), array(
// The HTTP method is a requirement for this route.
'_method' => $method,
'_permission' => "restful $lower_method $this->plugin_id",
'_permission' => "restful $lower_method $this->pluginId",
));
switch ($method) {
......
......@@ -78,7 +78,7 @@ public function post($id, EntityInterface $entity) {
$entity->save();
watchdog('rest', 'Created entity %type with ID %id.', array('%type' => $entity->entityType(), '%id' => $entity->id()));
$url = url(strtr($this->plugin_id, ':', '/') . '/' . $entity->id(), array('absolute' => TRUE));
$url = url(strtr($this->pluginId, ':', '/') . '/' . $entity->id(), array('absolute' => TRUE));
// 201 Created responses have an empty body.
return new ResourceResponse(NULL, 201, array('Location' => $url));
}
......
......@@ -8,7 +8,6 @@
namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
/**
* Mock implementation of a test block plugin used by Plugin API unit tests.
......
......@@ -8,7 +8,6 @@
namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
/**
* Mock implementation of a login block plugin used by Plugin API unit tests.
......@@ -24,8 +23,8 @@ class MockUserLoginBlock extends PluginBase {
*/
protected $title;
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
parent::__construct($configuration, $plugin_id, $discovery);
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->title = isset($configuration['title']) ? $configuration['title'] : '';
}
......
......@@ -8,7 +8,6 @@
namespace Drupal\tour;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\tour\TipPluginInterface;
/**
......@@ -40,10 +39,10 @@ abstract class TipPluginBase extends PluginBase implements TipPluginInterface {
/**
* Overrides \Drupal\Component\Plugin\PluginBase::__construct().
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
parent::__construct($configuration, $plugin_id, $discovery);
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->definition = $this->discovery->getDefinition($plugin_id);
$this->definition = $plugin_definition;
$this->module = $this->definition['module'];
}
......
......@@ -11,7 +11,6 @@
use Drupal\block\Plugin\Core\Entity\Block;
use Drupal\Component\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
/**
* Provides a generic Views block.
......@@ -42,8 +41,8 @@ class ViewsBlock extends BlockBase {
/**
* Overrides \Drupal\Component\Plugin\PluginBase::__construct().
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery, Block $entity) {
parent::__construct($configuration, $plugin_id, $discovery, $entity);
public function __construct(array $configuration, $plugin_id, array $plugin_definition, Block $entity) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $entity);
list($plugin, $delta) = explode(':', $this->getPluginId());
list($name, $this->displayID) = explode('-', $delta, 2);
......
......@@ -7,7 +7,6 @@
namespace Drupal\views\Plugin\views;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\PluginBase;
use Drupal\views\ViewExecutable;
......@@ -76,8 +75,8 @@ abstract class HandlerBase extends PluginBase {
/**
* Constructs a Handler object.
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
parent::__construct($configuration, $plugin_id, $discovery);
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->is_handler = TRUE;
}
......
......@@ -7,7 +7,6 @@
namespace Drupal\views\Plugin\views;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Component\Plugin\PluginBase as ComponentPluginBase;
use Drupal\views\ViewExecutable;
......@@ -57,10 +56,10 @@ abstract class PluginBase extends ComponentPluginBase {
/**
* Constructs a Plugin object.
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
parent::__construct($configuration, $plugin_id, $discovery);
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->definition = $this->discovery->getDefinition($plugin_id) + $configuration;
$this->definition = $plugin_definition + $configuration;
}
/**
......
......@@ -7,7 +7,6 @@
namespace Drupal\views\Plugin\views\join;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
/**
* @defgroup views_join_handlers Views join handlers
......@@ -143,8 +142,8 @@ class JoinPluginBase extends PluginBase {
/**
* Constructs a Drupal\views\Plugin\views\join\JoinPluginBase object.
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
parent::__construct($configuration, $plugin_id, $discovery);
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
// Merge in some default values.
$configuration += array(
'type' => 'LEFT',
......
......@@ -7,7 +7,6 @@
namespace Drupal\views\Plugin\views\join;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
/**
* Join handler for relationships that join with a subquery as the left field.
......@@ -27,8 +26,8 @@ class Subquery extends JoinPluginBase {
/**
* Constructs a Subquery object.
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
parent::__construct($configuration, $plugin_id, $discovery);
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->left_query = $this->configuration['left_query'];
}
......
......@@ -14,7 +14,6 @@
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\PluginBase;
use Drupal\views\Plugin\views\wizard\WizardInterface;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
/**
* Provides the interface and base class for Views Wizard plugins.
......@@ -114,8 +113,8 @@ abstract class WizardPluginBase extends PluginBase implements WizardInterface {
/**
* Constructs a WizardPluginBase object.
*/
public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {
parent::__construct($configuration, $plugin_id, $discovery);
public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->base_table = $this->definition['base_table'];
......
......@@ -249,9 +249,7 @@ public function testSetOptionDefault() {
* A test plugin instance.
*/
protected function getTestPlugin() {
$discovery = new StaticDiscovery();
$discovery->setDefinition('default', array());
return new TestHelperPlugin(array(), 'default', $discovery);
return new TestHelperPlugin(array(), 'default', array());
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment