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 = entity_load('view', 'test_view_storage_new');
$new_id = $view
->newDisplay('page', 'Test', 'test');
$display = $view
->get('display');
// Ensure the right display_plugin is created/instantiated.
$this
->assertEqual($display[$new_id]['display_plugin'], 'page', 'New page display "test" uses the right display plugin.');
$executable = $view
->get('executable');
$executable
->initDisplay();
$this
->assertTrue($executable->displayHandlers
->get($new_id) instanceof Page, 'New page display "test" uses the right display plugin.');
$view
->set('id', 'test_view_storage_new_new2');
$view
->save();
$values = config('views.view.test_view_storage_new_new2')
->get();
$this
->assertTrue(isset($values['display']['test']) && is_array($values['display']['test']), 'New display was saved.');
}