public function DisplayExtenderTest::testDisplayExtendersValidate in Drupal 8
Same name and namespace in other branches
- 9 core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayExtenderTest::testDisplayExtendersValidate()
- 10 core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayExtenderTest::testDisplayExtendersValidate()
Test display extenders validation.
File
- core/
modules/ views/ tests/ src/ Kernel/ Plugin/ DisplayExtenderTest.php, line 49
Class
- DisplayExtenderTest
- Tests the display extender plugins.
Namespace
Drupal\Tests\views\Kernel\PluginCode
public function testDisplayExtendersValidate() {
$this
->config('views.settings')
->set('display_extenders', [
'display_extender_test_3',
])
->save();
$view = Views::getView('test_view');
$errors = $view
->validate();
foreach ($view->displayHandlers as $id => $display) {
$this
->assertArrayHasKey($id, $errors);
$this
->assertContains('Display extender test error.', $errors[$id], new FormattableMarkup('Error message found for @id display', [
'@id' => $id,
]));
}
}