Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / views / src / Tests / TestHelperPlugin.php
1 <?php
2
3 namespace Drupal\views\Tests;
4
5 use Drupal\views\Plugin\views\PluginBase;
6
7 /**
8  * Wraps the plugin base class to be able to instantiate it.
9  *
10  * @see \Drupal\views\Plugin\views\PluginBase.
11  */
12 class TestHelperPlugin extends PluginBase {
13
14   /**
15    * Stores the defined options.
16    *
17    * @var array
18    */
19   protected $definedOptions = [];
20
21   /**
22    * Calls the protected method setOptionDefaults().
23    *
24    * @see \Drupal\views\Plugin\views\PluginBase::setOptionDefaults()
25    */
26   public function testSetOptionDefaults(&$storage, $options, $level = 0) {
27     $this->setOptionDefaults($storage, $options, $level);
28   }
29
30   /**
31    * Allows to set the defined options.
32    *
33    * @param array $options
34    *
35    * @return $this
36    */
37   public function setDefinedOptions($options) {
38     $this->definedOptions = $options;
39
40     return $this;
41   }
42
43   /**
44    * {@inheritdoc}
45    */
46   protected function defineOptions() {
47     // Normally we provide a limited set of options, but for testing purposes we
48     // make it possible to set the defined options statically.
49     return $this->definedOptions;
50   }
51
52 }