Skip to content
Snippets Groups Projects
Commit cc38404b authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1792844 by tim.plunkett: Change more public properties to protected in...

Issue #1792844 by tim.plunkett: Change more public properties to protected in ViewExecutable and ViewStorage.
parent 805fa869
No related branches found
No related tags found
No related merge requests found
Showing
with 76 additions and 73 deletions
......@@ -52,7 +52,7 @@ protected function defineOptions() {
* stuff with it.
*/
public function executeHookBlockList($delta = 0, $edit = array()) {
$delta = $this->view->storage->name . '-' . $this->display['id'];
$delta = $this->view->storage->get('name') . '-' . $this->display['id'];
$desc = $this->getOption('block_description');
if (empty($desc)) {
......@@ -193,14 +193,14 @@ public function submitOptionsForm(&$form, &$form_state) {
parent::submitOptionsForm($form, $form_state);
switch ($form_state['section']) {
case 'display_id':
$this->updateBlockBid($form_state['view']->storage->name, $this->display['id'], $this->display['new_id']);
$this->updateBlockBid($form_state['view']->storage->get('name'), $this->display['id'], $this->display['new_id']);
break;
case 'block_description':
$this->setOption('block_description', $form_state['values']['block_description']);
break;
case 'block_caching':
$this->setOption('block_caching', $form_state['values']['block_caching']);
$this->saveBlockCache($form_state['view']->storage->name . '-'. $form_state['display_id'], $form_state['values']['block_caching']);
$this->saveBlockCache($form_state['view']->storage->get('name') . '-'. $form_state['display_id'], $form_state['values']['block_caching']);
break;
}
}
......
......@@ -115,7 +115,7 @@ public function access() {
function get_base_table() {
if (!isset($this->base_table)) {
// This base_table is coming from the entity not the field.
$this->base_table = $this->view->storage->base_table;
$this->base_table = $this->view->storage->get('base_table');
// If the current field is under a relationship you can't be sure that the
// base table of the view is the base table of the current field.
......
......@@ -26,7 +26,7 @@ class TaxonomyIndexTid extends PrerenderList {
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
// @todo: Wouldn't it be possible to use $this->base_table and no if here?
if ($view->storage->base_table == 'node_revision') {
if ($view->storage->get('base_table') == 'node_revision') {
$this->additional_fields['nid'] = array('table' => 'node_revision', 'field' => 'nid');
}
else {
......
......@@ -35,7 +35,7 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$view_display = $this->view->storage->name . ':' . $this->view->current_display;
$view_display = $this->view->storage->get('name') . ':' . $this->view->current_display;
$options = array('' => t('-Select-'));
$options += views_get_views_as_options(FALSE, 'all', $view_display, FALSE, TRUE);
......
......@@ -196,7 +196,7 @@ function cache_get($type) {
* to be sure that we catch everything. Maybe that's a bad idea.
*/
function cache_flush() {
cache($this->table)->invalidateTags(array($this->view->storage->name => TRUE));
cache($this->table)->invalidateTags(array($this->view->storage->get('name') => TRUE));
}
/**
......@@ -324,7 +324,7 @@ public function generateResultsKey() {
}
}
$this->resultsKey = $this->view->storage->name . ':' . $this->displayHandler->display['id'] . ':results:' . md5(serialize($key_data));
$this->resultsKey = $this->view->storage->get('name') . ':' . $this->displayHandler->display['id'] . ':results:' . md5(serialize($key_data));
}
return $this->resultsKey;
......@@ -348,7 +348,7 @@ public function generateOutputKey() {
'base_url' => $GLOBALS['base_url'],
);
$this->outputKey = $this->view->storage->name . ':' . $this->displayHandler->display['id'] . ':output:' . md5(serialize($key_data));
$this->outputKey = $this->view->storage->get('name') . ':' . $this->displayHandler->display['id'] . ':output:' . md5(serialize($key_data));
}
return $this->outputKey;
......
......@@ -754,7 +754,7 @@ public function getPlugin($type) {
// Query plugins allow specifying a specific query class per base table.
if ($type == 'query') {
$views_data = views_fetch_data($this->view->storage->base_table);
$views_data = views_fetch_data($this->view->storage->get('base_table'));
$name = !empty($views_data['table']['base']['query class']) ? $views_data['table']['base']['query class'] : 'views_query';
}
......@@ -764,7 +764,7 @@ public function getPlugin($type) {
// Initialize the plugin. Query has a unique method signature.
if ($type == 'query') {
$plugin->init($this->view->storage->base_table, $this->view->storage->base_field, $options['options']);
$plugin->init($this->view->storage->get('base_table'), $this->view->storage->get('base_field'), $options['options']);
}
else {
$plugin->init($this->view, $this, $options['options']);
......@@ -939,7 +939,7 @@ public function optionLink($text, $section, $class = '', $title = '') {
$title = $text;
}
return l($text, 'admin/structure/views/nojs/display/' . $this->view->storage->name . '/' . $this->display['id'] . '/' . $section, array('attributes' => array('class' => 'views-ajax-link ' . $class, 'title' => $title, 'id' => drupal_html_id('views-' . $this->display['id'] . '-' . $section)), 'html' => TRUE));
return l($text, 'admin/structure/views/nojs/display/' . $this->view->storage->get('name') . '/' . $this->display['id'] . '/' . $section, array('attributes' => array('class' => 'views-ajax-link ' . $class, 'title' => $title, 'id' => drupal_html_id('views-' . $this->display['id'] . '-' . $section)), 'html' => TRUE));
}
/**
......@@ -1433,7 +1433,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$access = $this->getOption('access');
$form['access']['type'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('access', NULL, array($this->view->storage->base_table)),
'#options' => views_fetch_plugin_names('access', NULL, array($this->view->storage->get('base_table'))),
'#default_value' => $access['type'],
);
......@@ -1468,7 +1468,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$cache = $this->getOption('cache');
$form['cache']['type'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('cache', NULL, array($this->view->storage->base_table)),
'#options' => views_fetch_plugin_names('cache', NULL, array($this->view->storage->get('base_table'))),
'#default_value' => $cache['type'],
);
......@@ -1529,7 +1529,7 @@ public function buildOptionsForm(&$form, &$form_state) {
// Doesn't make sense to show a field setting here if we aren't querying
// an entity base table. Also, we make sure that there's at least one
// entity type with a translation handler attached.
if (in_array($this->view->storage->base_table, $entity_tables) && $has_translation_handlers) {
if (in_array($this->view->storage->get('base_table'), $entity_tables) && $has_translation_handlers) {
$languages = array(
'***CURRENT_LANGUAGE***' => t("Current user's language"),
'***DEFAULT_LANGUAGE***' => t("Default site language"),
......@@ -1559,7 +1559,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$style_plugin = $this->getPlugin('style');
$form['style'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('style', $this->getStyleType(), array($this->view->storage->base_table)),
'#options' => views_fetch_plugin_names('style', $this->getStyleType(), array($this->view->storage->get('base_table'))),
'#default_value' => $style_plugin->definition['id'],
'#description' => t('If the style you choose has settings, be sure to click the settings button that will appear next to it in the View summary.'),
);
......@@ -1601,7 +1601,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$row_plugin_instance = $this->getPlugin('row');
$form['row'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('row', $this->getStyleType(), array($this->view->storage->base_table)),
'#options' => views_fetch_plugin_names('row', $this->getStyleType(), array($this->view->storage->get('base_table'))),
'#default_value' => $row_plugin_instance->definition['id'],
);
......@@ -1616,7 +1616,7 @@ public function buildOptionsForm(&$form, &$form_state) {
break;
case 'link_display':
$form['#title'] .= t('Which display to use for path');
foreach ($this->view->storage->display as $display_id => $display) {
foreach ($this->view->storage->get('display') as $display_id => $display) {
if ($this->view->displayHandlers[$display_id]->hasPath()) {
$options[$display_id] = $display['display_title'];
}
......@@ -1955,7 +1955,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$exposed_form = $this->getOption('exposed_form');
$form['exposed_form']['type'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('exposed_form', NULL, array($this->view->storage->base_table)),
'#options' => views_fetch_plugin_names('exposed_form', NULL, array($this->view->storage->get('base_table'))),
'#default_value' => $exposed_form['type'],
);
......@@ -1989,7 +1989,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$pager = $this->getOption('pager');
$form['pager']['type'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('pager', !$this->usesPager() ? 'basic' : NULL, array($this->view->storage->base_table)),
'#options' => views_fetch_plugin_names('pager', !$this->usesPager() ? 'basic' : NULL, array($this->view->storage->get('base_table'))),
'#default_value' => $pager['type'],
);
......@@ -2646,8 +2646,8 @@ public function getSpecialBlocks() {
$blocks = array();
if ($this->usesExposedFormInBlock()) {
$delta = '-exp-' . $this->view->storage->name . '-' . $this->display['id'];
$desc = t('Exposed form: @view-@display_id', array('@view' => $this->view->storage->name, '@display_id' => $this->display['id']));
$delta = '-exp-' . $this->view->storage->get('name') . '-' . $this->display['id'];
$desc = t('Exposed form: @view-@display_id', array('@view' => $this->view->storage->get('name'), '@display_id' => $this->display['id']));
$blocks[$delta] = array(
'info' => $desc,
......
......@@ -50,7 +50,7 @@ public function init(ViewExecutable $view, &$display, $options = NULL) {
// Set the default row style. Ideally this would be part of the option
// definition, but in this case it's dependent on the view's base table,
// which we don't know until init().
$row_plugins = views_fetch_plugin_names('row', $this->getStyleType(), array($view->storage->base_table));
$row_plugins = views_fetch_plugin_names('row', $this->getStyleType(), array($view->storage->get('base_table')));
$default_row_plugin = key($row_plugins);
if (empty($this->options['row']['type'])) {
$this->options['row']['type'] = $default_row_plugin;
......@@ -151,8 +151,9 @@ public function optionsSummary(&$categories, &$options) {
}
elseif (count($displays) == 1) {
$display = array_shift($displays);
if (!empty($this->view->storage->display[$display])) {
$attach_to = check_plain($this->view->storage->display[$display]['display_title']);
$displays = $this->view->storage->get('display');
if (!empty($displays[$display])) {
$attach_to = check_plain($displays[$display]['display_title']);
}
}
......@@ -194,7 +195,7 @@ public function buildOptionsForm(&$form, &$form_state) {
case 'displays':
$form['#title'] .= t('Attach to');
$displays = array();
foreach ($this->view->storage->display as $display_id => $display) {
foreach ($this->view->storage->get('display') as $display_id => $display) {
// @todo The display plugin should have display_title and id as well.
if (!empty($this->view->displayHandlers[$display_id]) && $this->view->displayHandlers[$display_id]->acceptAttachments()) {
$displays[$display_id] = $display['display_title'];
......
......@@ -80,7 +80,7 @@ public function executeHookMenu($callbacks) {
// views_arg_load -- which lives in views.module
$bits = explode('/', $this->getOption('path'));
$page_arguments = array($this->view->storage->name, $this->display['id']);
$page_arguments = array($this->view->storage->get('name'), $this->display['id']);
$this->view->initHandlers();
$view_arguments = $this->view->argument;
......@@ -141,7 +141,7 @@ public function executeHookMenu($callbacks) {
'access callback' => 'views_access',
'access arguments' => $access_arguments,
// Identify URL embedded arguments and correlate them to a handler
'load arguments' => array($this->view->storage->name, $this->display['id'], '%index'),
'load arguments' => array($this->view->storage->get('name'), $this->display['id'], '%index'),
);
$menu = $this->getOption('menu');
if (empty($menu)) {
......@@ -202,7 +202,7 @@ public function executeHookMenu($callbacks) {
'access callback' => 'views_access',
'access arguments' => $access_arguments,
// Identify URL embedded arguments and correlate them to a handler
'load arguments' => array($this->view->storage->name, $this->display['id'], '%index'),
'load arguments' => array($this->view->storage->get('name'), $this->display['id'], '%index'),
'title' => $tab_options['title'],
'description' => $tab_options['description'],
'menu_name' => $tab_options['name'],
......
......@@ -299,8 +299,8 @@ function reset_form(&$form, &$form_state) {
// remember settings.
$display_id = ($this->view->display_handler->isDefaulted('filters')) ? 'default' : $this->view->current_display;
if (isset($_SESSION['views'][$this->view->storage->name][$display_id])) {
unset($_SESSION['views'][$this->view->storage->name][$display_id]);
if (isset($_SESSION['views'][$this->view->storage->get('name')][$display_id])) {
unset($_SESSION['views'][$this->view->storage->get('name')][$display_id]);
}
// Set the form to allow redirect.
......
......@@ -1597,19 +1597,19 @@ public function themeFunctions() {
$display = $this->view->display_handler->display;
if (!empty($display)) {
$themes[] = $hook . '__' . $this->view->storage->name . '__' . $display['id'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->storage->name . '__' . $display['id'];
$themes[] = $hook . '__' . $this->view->storage->get('name') . '__' . $display['id'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->storage->get('name') . '__' . $display['id'];
$themes[] = $hook . '__' . $display['id'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $display['id'];
if ($display['id'] != $display['display_plugin']) {
$themes[] = $hook . '__' . $this->view->storage->name . '__' . $display['display_plugin'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->storage->name . '__' . $display['display_plugin'];
$themes[] = $hook . '__' . $this->view->storage->get('name') . '__' . $display['display_plugin'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->storage->get('name') . '__' . $display['display_plugin'];
$themes[] = $hook . '__' . $display['display_plugin'] . '__' . $this->options['id'];
$themes[] = $hook . '__' . $display['display_plugin'];
}
}
$themes[] = $hook . '__' . $this->view->storage->name . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->storage->name;
$themes[] = $hook . '__' . $this->view->storage->get('name') . '__' . $this->options['id'];
$themes[] = $hook . '__' . $this->view->storage->get('name');
$themes[] = $hook . '__' . $this->options['id'];
$themes[] = $hook;
......
......@@ -1241,8 +1241,8 @@ function store_group_input($input, $status) {
// false means that we got a setting that means to recuse ourselves,
// so we should erase whatever happened to be there.
if ($status === FALSE && isset($_SESSION['views'][$this->view->storage->name][$display_id])) {
$session = &$_SESSION['views'][$this->view->storage->name][$display_id];
if ($status === FALSE && isset($_SESSION['views'][$this->view->storage->get('name')][$display_id])) {
$session = &$_SESSION['views'][$this->view->storage->get('name')][$display_id];
if (isset($session[$this->options['group_info']['identifier']])) {
unset($session[$this->options['group_info']['identifier']]);
......@@ -1250,11 +1250,11 @@ function store_group_input($input, $status) {
}
if ($status !== FALSE) {
if (!isset($_SESSION['views'][$this->view->storage->name][$display_id])) {
$_SESSION['views'][$this->view->storage->name][$display_id] = array();
if (!isset($_SESSION['views'][$this->view->storage->get('name')][$display_id])) {
$_SESSION['views'][$this->view->storage->get('name')][$display_id] = array();
}
$session = &$_SESSION['views'][$this->view->storage->name][$display_id];
$session = &$_SESSION['views'][$this->view->storage->get('name')][$display_id];
$session[$this->options['group_info']['identifier']] = $input[$this->options['group_info']['identifier']];
}
......@@ -1335,8 +1335,8 @@ public function storeExposedInput($input, $status) {
// false means that we got a setting that means to recuse ourselves,
// so we should erase whatever happened to be there.
if (!$status && isset($_SESSION['views'][$this->view->storage->name][$display_id])) {
$session = &$_SESSION['views'][$this->view->storage->name][$display_id];
if (!$status && isset($_SESSION['views'][$this->view->storage->get('name')][$display_id])) {
$session = &$_SESSION['views'][$this->view->storage->get('name')][$display_id];
if ($operator && isset($session[$this->options['expose']['operator_id']])) {
unset($session[$this->options['expose']['operator_id']]);
}
......@@ -1347,11 +1347,11 @@ public function storeExposedInput($input, $status) {
}
if ($status) {
if (!isset($_SESSION['views'][$this->view->storage->name][$display_id])) {
$_SESSION['views'][$this->view->storage->name][$display_id] = array();
if (!isset($_SESSION['views'][$this->view->storage->get('name')][$display_id])) {
$_SESSION['views'][$this->view->storage->get('name')][$display_id] = array();
}
$session = &$_SESSION['views'][$this->view->storage->name][$display_id];
$session = &$_SESSION['views'][$this->view->storage->get('name')][$display_id];
if ($operator && isset($input[$this->options['expose']['operator_id']])) {
$session[$this->options['expose']['operator_id']] = $input[$this->options['expose']['operator_id']];
......
......@@ -1281,7 +1281,7 @@ public function query($get_count = FALSE) {
$query = Database::getConnection($target, $key)
->select($this->base_table, $this->base_table, $options)
->addTag('views')
->addTag('views_' . $this->view->storage->name);
->addTag('views_' . $this->view->storage->get('name'));
// Add the tags added to the view itself.
foreach ($this->tags as $tag) {
......@@ -1512,7 +1512,7 @@ function execute(ViewExecutable $view) {
drupal_set_message($e->getMessage(), 'error');
}
else {
throw new DatabaseExceptionWrapper(format_string('Exception in @human_name[@view_name]: @message', array('@human_name' => $view->storage->getHumanName(), '@view_name' => $view->storage->name, '@message' => $e->getMessage())));
throw new DatabaseExceptionWrapper(format_string('Exception in @human_name[@view_name]: @message', array('@human_name' => $view->storage->getHumanName(), '@view_name' => $view->storage->get('name'), '@message' => $e->getMessage())));
}
}
......@@ -1643,7 +1643,7 @@ function load_entities(&$results) {
}
function add_signature(ViewExecutable $view) {
$view->query->add_field(NULL, "'" . $view->storage->name . ':' . $view->current_display . "'", 'view_name');
$view->query->add_field(NULL, "'" . $view->storage->get('name') . ':' . $view->current_display . "'", 'view_name');
}
function get_aggregation_info() {
......
......@@ -132,10 +132,10 @@ public function buildOptionsForm(&$form, &$form_state) {
// TODO: check the field is the correct sort?
// or let users hang themselves at this stage and check later?
if ($view->type == 'Default') {
$views[t('Default Views')][$view->storage->name] = $view->storage->name;
$views[t('Default Views')][$view->storage->get('name')] = $view->storage->get('name');
}
else {
$views[t('Existing Views')][$view->storage->name] = $view->storage->name;
$views[t('Existing Views')][$view->storage->get('name')] = $view->storage->get('name');
}
}
}
......@@ -171,7 +171,7 @@ function get_temporary_view() {
* When the form is submitted, take sure to clear the subquery string cache.
*/
public function submitOptionsForm(&$form, &$form_state) {
$cid = 'views_relationship_groupwise_max:' . $this->view->storage->name . ':' . $this->view->current_display . ':' . $this->options['id'];
$cid = 'views_relationship_groupwise_max:' . $this->view->storage->get('name') . ':' . $this->view->current_display . ':' . $this->options['id'];
cache('views_results')->delete($cid);
}
......@@ -362,7 +362,7 @@ public function query() {
}
else {
// Get the stored subquery SQL string.
$cid = 'views_relationship_groupwise_max:' . $this->view->storage->name . ':' . $this->view->current_display . ':' . $this->options['id'];
$cid = 'views_relationship_groupwise_max:' . $this->view->storage->get('name') . ':' . $this->view->current_display . ':' . $this->options['id'];
$cache = cache('views_results')->get($cid);
if (isset($cache->data)) {
$def['left_query'] = $cache->data;
......
......@@ -124,7 +124,7 @@ public function testDefaultViews() {
foreach ($views as $name => $view_storage) {
$view = new ViewExecutable($view_storage);
$view->initDisplay();
foreach ($view->storage->display as $display_id => $display) {
foreach ($view->storage->get('display') as $display_id => $display) {
$view->setDisplay($display_id);
// Add any args if needed.
......@@ -132,7 +132,7 @@ public function testDefaultViews() {
$view->preExecute($this->viewArgMap[$name]);
}
$this->assert(TRUE, format_string('View @view will be executed.', array('@view' => $view->storage->name)));
$this->assert(TRUE, format_string('View @view will be executed.', array('@view' => $view->storage->get('name'))));
$view->execute();
$tokens = array('@name' => $name, '@display_id' => $display_id);
......
......@@ -39,7 +39,7 @@ protected function getBasicView() {
// Create the basic view.
$view = $this->createViewFromConfig('test_view');
$view->storage->addDisplay('default');
$view->storage->base_table = 'views_test_data';
$view->storage->set('base_table', 'views_test_data');
// Set up the fields we need.
$display = $view->storage->newDisplay('default', 'Master', 'default');
......@@ -167,7 +167,7 @@ function testHeaderStorage() {
// Some hook_views_pre_render in views_test_data.module adds the test css/js file.
// so they should be added to the css/js storage.
$view = $this->getView();
$view->storage->name = 'test_cache_header_storage';
$view->storage->set('name', 'test_cache_header_storage');
$view->display_handler->overrideOption('cache', array(
'type' => 'time',
'options' => array(
......@@ -193,7 +193,7 @@ function testHeaderStorage() {
// Now add some css/jss before running the view.
// Make sure that this css is not added when running the cached view.
$view->storage->name = 'test_cache_header_storage_2';
$view->storage->set('name', 'test_cache_header_storage_2');
$system_css_path = drupal_get_path('module', 'system') . '/system.maintenance.css';
drupal_add_css($system_css_path);
......
......@@ -53,8 +53,9 @@ function testDisplayPlugin() {
// Add a new 'display_test' display and test it's there.
$view->storage->addDisplay('display_test');
$displays = $view->storage->get('display');
$this->assertTrue(isset($view->storage->display['display_test_1']), 'Added display has been assigned to "display_test_1"');
$this->assertTrue(isset($displays['display_test_1']), 'Added display has been assigned to "display_test_1"');
// Check the the display options are like expected.
$options = array(
......@@ -64,7 +65,7 @@ function testDisplayPlugin() {
'display_title' => 'Display test',
'position' => NULL,
);
$this->assertEqual($view->storage->display['display_test_1'], $options);
$this->assertEqual($displays['display_test_1'], $options);
$view->setDisplay('display_test_1');
......
......@@ -27,7 +27,7 @@ public function testDisplayExtenderUI() {
config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
$view = $this->getView();
$view_edit_url = "admin/structure/views/view/{$view->storage->name}/edit";
$view_edit_url = "admin/structure/views/view/{$view->storage->get('name')}/edit";
$display_option_url = 'admin/structure/views/nojs/display/test_view/default/test_extender_test_option';
$this->drupalGet($view_edit_url);
......@@ -37,7 +37,7 @@ public function testDisplayExtenderUI() {
$this->drupalPost($display_option_url, array('test_extender_test_option' => $random_text), t('Apply'));
$this->assertLink($random_text);
$this->drupalPost(NULL, array(), t('Save'));
$view = views_get_view($view->storage->name);
$view = views_get_view($view->storage->get('name'));
$view->initDisplay();
$this->assertEqual($view->display_handler->getOption('test_extender_test_option'), $random_text, 'Make sure that the display extender option got saved.');
}
......
......@@ -117,9 +117,10 @@ public function testReorderDisplay() {
$this->drupalPost(NULL, array(), t('Save'));
$view = views_get_view($view['name']);
$this->assertEqual($view->storage->display['default']['position'], 0, 'Make sure the master display comes first.');
$this->assertEqual($view->storage->display['block_1']['position'], 1, 'Make sure the block display comes before the page display.');
$this->assertEqual($view->storage->display['page_1']['position'], 2, 'Make sure the page display comes after the block display.');
$displays = $view->storage->get('display');
$this->assertEqual($displays['default']['position'], 0, 'Make sure the master display comes first.');
$this->assertEqual($displays['block_1']['position'], 1, 'Make sure the block display comes before the page display.');
$this->assertEqual($displays['page_1']['position'], 2, 'Make sure the page display comes after the block display.');
}
/**
......
......@@ -27,7 +27,7 @@ public function testRedirect() {
$view = $this->getBasicView();
$random_destination = $this->randomName();
$edit_path = "admin/structure/views/view/{$view->storage->name}/edit";
$edit_path = "admin/structure/views/view/{$view->storage->get('name')}/edit";
$this->drupalPost($edit_path, array(), t('Save') , array('query' => array('destination' => $random_destination)));
$this->assertUrl($random_destination, array(), 'Make sure the user got redirected to the expected page defined in the destination.');
......@@ -39,8 +39,8 @@ public function testRedirect() {
$random_destination = $this->randomName();
$new_path = $this->randomName();
$edit_path = "admin/structure/views/view/{$view->storage->name}/edit";
$path_edit_path = "admin/structure/views/nojs/display/{$view->storage->name}/page_1/path";
$edit_path = "admin/structure/views/view/{$view->storage->get('name')}/edit";
$path_edit_path = "admin/structure/views/nojs/display/{$view->storage->get('name')}/page_1/path";
$this->drupalPost($path_edit_path, array('path' => $new_path), t('Apply'));
$this->drupalPost($edit_path, array(), t('Save'), array('query' => array('destination' => 'test-redirect-view')));
......
......@@ -27,10 +27,10 @@ public static function getInfo() {
*/
public function testRowUI() {
$view = $this->getView();
$view_edit_url = "admin/structure/views/view/{$view->storage->name}/edit";
$view_edit_url = "admin/structure/views/view/{$view->storage->get('name')}/edit";
$row_plugin_url = "admin/structure/views/nojs/display/{$view->storage->name}/default/row";
$row_options_url = "admin/structure/views/nojs/display/{$view->storage->name}/default/row_options";
$row_plugin_url = "admin/structure/views/nojs/display/{$view->storage->get('name')}/default/row";
$row_options_url = "admin/structure/views/nojs/display/{$view->storage->get('name')}/default/row_options";
$this->drupalGet($row_plugin_url);
$this->assertFieldByName('row', 'fields', 'The default row plugin selected in the UI should be fields.');
......@@ -51,7 +51,7 @@ public function testRowUI() {
$this->drupalPost($view_edit_url, array(), t('Save'));
$this->assertLink(t('Test row plugin'), 0, 'Make sure the test row plugin is shown in the UI');
$view = views_get_view($view->storage->name);
$view = views_get_view($view->storage->get('name'));
$view->initDisplay();
$row = $view->display_handler->getOption('row');
$this->assertEqual($row['type'], 'test_row', 'Make sure that the test_row got saved as used row plugin.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment