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