public function DisplayKernelTest::testDefaultOptions in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Tests/Plugin/DisplayKernelTest.php \Drupal\views\Tests\Plugin\DisplayKernelTest::testDefaultOptions()
Tests the default display options.
File
- core/
modules/ views/ src/ Tests/ Plugin/ DisplayKernelTest.php, line 68 - Contains \Drupal\views\Tests\Plugin\DisplayKernelTest.
Class
- DisplayKernelTest
- Drupal unit tests for the DisplayPluginBase class.
Namespace
Drupal\views\Tests\PluginCode
public function testDefaultOptions() {
// Save the view.
$view = Views::getView('test_display_defaults');
$view
->mergeDefaults();
$view
->save();
// Reload to get saved storage values.
$view = Views::getView('test_display_defaults');
$view
->initDisplay();
$display_data = $view->storage
->get('display');
foreach ($view->displayHandlers as $id => $display) {
// Test the view plugin options against the storage.
foreach ($this->pluginTypes as $type) {
$options = $display
->getOption($type);
$this
->assertIdentical($display_data[$id]['display_options'][$type]['options'], $options['options']);
}
// Test the view handler options against the storage.
foreach ($this->handlerTypes as $type) {
$options = $display
->getOption($type);
$this
->assertIdentical($display_data[$id]['display_options'][$type], $options);
}
}
}