class DisplayExtenderTest
Same name in this branch
- 11.x core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayExtenderTest
Same name in other branches
- 9 core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayExtenderTest
- 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php \Drupal\views_test_data\Plugin\views\display_extender\DisplayExtenderTest
- 8.9.x core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayExtenderTest
- 8.9.x core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php \Drupal\views_test_data\Plugin\views\display_extender\DisplayExtenderTest
- 10 core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayExtenderTest
- 10 core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php \Drupal\views_test_data\Plugin\views\display_extender\DisplayExtenderTest
Defines a display extender test plugin.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface
- class \Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase extends \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views_test_data\Plugin\views\display_extender\DisplayExtenderTest extends \Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase
- class \Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase extends \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of DisplayExtenderTest
1 file declares its use of DisplayExtenderTest
- DisplayExtenderTest.php in core/
modules/ views/ tests/ src/ Kernel/ Plugin/ DisplayExtenderTest.php
File
-
core/
modules/ views/ tests/ modules/ views_test_data/ src/ Plugin/ views/ display_extender/ DisplayExtenderTest.php, line 16
Namespace
Drupal\views_test_data\Plugin\views\display_extenderView source
class DisplayExtenderTest extends DisplayExtenderPluginBase {
/**
* Stores some state booleans to be sure a certain method got called.
*
* @var array
*/
public $testState;
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['test_extender_test_option'] = [
'default' => $this->t('Empty'),
];
return $options;
}
/**
* {@inheritdoc}
*/
public function optionsSummary(&$categories, &$options) {
parent::optionsSummary($categories, $options);
$categories['display_extender_test'] = [
'title' => $this->t('Display extender test settings'),
'column' => 'second',
'build' => [
'#weight' => -100,
],
];
$options['test_extender_test_option'] = [
'category' => 'display_extender_test',
'title' => $this->t('Test option'),
'value' => Unicode::truncate($this->options['test_extender_test_option'], 24, FALSE, TRUE),
];
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
switch ($form_state->get('section')) {
case 'test_extender_test_option':
$form['#title'] .= $this->t('Test option');
$form['test_extender_test_option'] = [
'#title' => $this->t('Test option'),
'#type' => 'textfield',
'#description' => $this->t('This is a textfield for test_option.'),
'#default_value' => $this->options['test_extender_test_option'],
];
}
}
/**
* {@inheritdoc}
*/
public function submitOptionsForm(&$form, FormStateInterface $form_state) {
parent::submitOptionsForm($form, $form_state);
switch ($form_state->get('section')) {
case 'test_extender_test_option':
$this->options['test_extender_test_option'] = $form_state->getValue('test_extender_test_option');
break;
}
}
/**
* {@inheritdoc}
*/
public function defaultableSections(&$sections, $section = NULL) {
$sections['test_extender_test_option'] = [
'test_extender_test_option',
];
}
/**
* {@inheritdoc}
*/
public function query() {
$this->testState['query'] = TRUE;
}
/**
* {@inheritdoc}
*/
public function preExecute() {
$this->testState['preExecute'] = TRUE;
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.