Tests adding, saving, and loading displays on configuration entities.
protected function displayTests() {
// Check whether a display can be added and saved to a View.
$view = $this
->loadView('frontpage');
$view
->newDisplay('page', 'Test', 'test');
$new_display = $view
->get('display');
// Ensure the right display_plugin is created/instantiated.
$this
->assertEqual($new_display['test']['display_plugin'], 'page', 'New page display "test" uses the right display plugin.');
$this
->assertTrue($view
->get('executable')->displayHandlers[$new_display['test']['id']] instanceof Page, 'New page display "test" uses the right display plugin.');
$view
->set('name', 'frontpage_new');
$view
->save();
$values = config('views.view.frontpage_new')
->get();
$this
->assertTrue(isset($values['display']['test']) && is_array($values['display']['test']), 'New display was saved.');
}