Commit d0492226 authored by catch's avatar catch

Issue #1876942 by damiankloip, dawehner, tim.plunkett: Use direct methods...

Issue #1876942 by damiankloip, dawehner, tim.plunkett: Use direct methods instead of arrayAccess for display handlers.
parent c1a72540
......@@ -13,7 +13,7 @@
* The \ArrayAccess implementation is only for backwards compatibility, it is
* deprecated and should not be used by new code.
*/
abstract class PluginBag implements \ArrayAccess, \Iterator, \Countable {
abstract class PluginBag implements \Iterator, \Countable {
/**
* Stores all instantiated plugins.
......@@ -63,7 +63,7 @@ public function has($instance_id) {
* @param string $instance_id
* The ID of the plugin instance being retrieved.
*/
public function get($instance_id) {
public function &get($instance_id) {
if (!isset($this->pluginInstances[$instance_id])) {
$this->initializePlugin($instance_id);
}
......@@ -124,50 +124,11 @@ public function setInstanceIDs(array $instance_ids) {
$this->instanceIDs = $instance_ids;
}
/**
* Implements \ArrayAccess::offsetExists().
*
* This is deprecated, use \Drupal\Component\Plugin\PluginBag::has().
*/
public function offsetExists($offset) {
return isset($this->pluginInstances[$offset]) || isset($this->instanceIDs[$offset]);
}
/**
* Implements \ArrayAccess::offsetGet().
*
* This is deprecated, use \Drupal\Component\Plugin\PluginBag::get().
*/
public function offsetGet($offset) {
if (!isset($this->pluginInstances[$offset])) {
$this->initializePlugin($offset);
}
return $this->pluginInstances[$offset];
}
/**
* Implements \ArrayAccess::offsetSet().
*
* This is deprecated, use \Drupal\Component\Plugin\PluginBag::set().
*/
public function offsetSet($offset, $value) {
$this->pluginInstances[$offset] = $value;
}
/**
* Implements \ArrayAccess::offsetUnset().
*
* This is deprecated, use \Drupal\Component\Plugin\PluginBag::remove().
*/
public function offsetUnset($offset) {
unset($this->pluginInstances[$offset]);
}
/**
* Implements \Iterator::current().
*/
public function current() {
return $this->offsetGet($this->key());
return $this->get($this->key());
}
/**
......
......@@ -114,8 +114,8 @@ public function _testSimpleFieldRender() {
public function _testFormatterSimpleFieldRender() {
$view = views_get_view('test_view_fieldapi');
$this->prepareView($view);
$view->displayHandlers['default']->options['fields'][$this->fields[0]['field_name']]['type'] = 'text_trimmed';
$view->displayHandlers['default']->options['fields'][$this->fields[0]['field_name']]['settings'] = array(
$view->displayHandlers->get('default')->options['fields'][$this->fields[0]['field_name']]['type'] = 'text_trimmed';
$view->displayHandlers->get('default')->options['fields'][$this->fields[0]['field_name']]['settings'] = array(
'trim_length' => 3,
);
$this->executeView($view);
......@@ -134,8 +134,8 @@ public function _testMultipleFieldRender() {
// Test delta limit.
$this->prepareView($view);
$view->displayHandlers['default']->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_limit'] = 3;
$view->displayHandlers->get('default')->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_limit'] = 3;
$this->executeView($view);
for ($i = 0; $i < 3; $i++) {
......@@ -156,9 +156,9 @@ public function _testMultipleFieldRender() {
// Test delta limit + offset
$this->prepareView($view);
$view->displayHandlers['default']->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_limit'] = 3;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_offset'] = 1;
$view->displayHandlers->get('default')->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_limit'] = 3;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_offset'] = 1;
$this->executeView($view);
for ($i = 0; $i < 3; $i++) {
......@@ -175,10 +175,10 @@ public function _testMultipleFieldRender() {
// Test delta limit + reverse.
$this->prepareView($view);
$view->displayHandlers['default']->options['fields'][$field_name]['delta_offset'] = 0;
$view->displayHandlers['default']->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_limit'] = 3;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_reversed'] = TRUE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_offset'] = 0;
$view->displayHandlers->get('default')->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_limit'] = 3;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_reversed'] = TRUE;
$this->executeView($view);
for ($i = 0; $i < 3; $i++) {
......@@ -196,10 +196,10 @@ public function _testMultipleFieldRender() {
// Test delta first last.
$this->prepareView($view);
$view->displayHandlers['default']->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_limit'] = 0;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_first_last'] = TRUE;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_reversed'] = FALSE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_limit'] = 0;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_first_last'] = TRUE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_reversed'] = FALSE;
$this->executeView($view);
for ($i = 0; $i < 3; $i++) {
......@@ -214,10 +214,10 @@ public function _testMultipleFieldRender() {
// Test delta limit + custom seperator.
$this->prepareView($view);
$view->displayHandlers['default']->options['fields'][$field_name]['delta_first_last'] = FALSE;
$view->displayHandlers['default']->options['fields'][$field_name]['delta_limit'] = 3;
$view->displayHandlers['default']->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers['default']->options['fields'][$field_name]['separator'] = ':';
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_first_last'] = FALSE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['delta_limit'] = 3;
$view->displayHandlers->get('default')->options['fields'][$field_name]['group_rows'] = TRUE;
$view->displayHandlers->get('default')->options['fields'][$field_name]['separator'] = ':';
$this->executeView($view);
for ($i = 0; $i < 3; $i++) {
......
......@@ -38,7 +38,7 @@ public function testArgument() {
$view = views_get_view('test_view');
foreach (array('en' => 'John', 'xx-lolspeak' => 'George') as $langcode => $name) {
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('arguments', array(
$view->displayHandlers->get('default')->overrideOption('arguments', array(
'langcode' => array(
'id' => 'langcode',
'table' => 'views_test_data',
......
......@@ -37,7 +37,7 @@ public static function getInfo() {
public function testField() {
$view = views_get_view('test_view');
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'langcode' => array(
'id' => 'langcode',
'table' => 'views_test_data',
......
......@@ -38,7 +38,7 @@ public function testFilter() {
$view = views_get_view('test_view');
foreach (array('en' => 'John', 'xx-lolspeak' => 'George') as $langcode => $name) {
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'langcode' => array(
'id' => 'langcode',
'table' => 'views_test_data',
......
......@@ -36,33 +36,21 @@ protected function testPluginBag() {
$first_instance_id = key($definitions);
foreach ($definitions as $instance_id => $definition) {
$this->assertTrue(isset($plugin_bag[$instance_id]), format_string('Plugin instance @instance_id exits on the bag', array('@instance_id' => $instance_id)));
$this->assertTrue($plugin_bag->has($instance_id), format_string('Plugin instance @instance_id exits on the bag', array('@instance_id' => $instance_id)));
$this->assertTrue($plugin_bag[$instance_id] instanceof $definition['class'], 'Getting the plugin from the bag worked.');
$this->assertTrue($plugin_bag->get($instance_id) instanceof $definition['class'], 'Getting the plugin from the bag worked.');
}
// A non existing instance_id shouldn't exist on the bag.
$random_name = $this->randomName();
$random_name_2 = $this->randomName();
$this->assertFalse(isset($plugin_bag[$random_name]), 'A random instance_id should not exist on the plugin bag.');
$this->assertFalse($plugin_bag->has($random_name_2), 'A random instance_id should not exist on the plugin bag.');
$this->assertFalse($plugin_bag->has($random_name), 'A random instance_id should not exist on the plugin bag.');
// Set a new plugin instance to the bag, to test offsetSet.
$plugin_bag[$random_name] = $this->mockBlockManager->createInstance($first_instance_id, array());
$plugin_bag->set($random_name_2, $this->mockBlockManager->createInstance($first_instance_id, array()));
$this->assertTrue(isset($plugin_bag[$random_name]), 'A random instance_id should exist after manual setting on the plugin bag.');
$this->assertTrue(isset($plugin_bag[$random_name_2]), 'A random instance_id should exist after manual setting on the plugin bag.');
$plugin_bag->set($random_name, $this->mockBlockManager->createInstance($first_instance_id, array()));
$this->assertTrue($plugin_bag->has($random_name), 'A random instance_id should exist after manual setting on the plugin bag.');
$this->assertTrue($plugin_bag->has($random_name_2), 'A random instance_id should exist after manual setting on the plugin bag.');
// Remove the previous added element and check whether it still exists.
unset($plugin_bag[$random_name]);
$plugin_bag->remove($random_name_2);
$this->assertFalse(isset($plugin_bag[$random_name]), 'A random instance_id should not exist on the plugin bag after removing.');
$this->assertFalse(isset($plugin_bag[$random_name_2]), 'A random instance_id should not exist on the plugin bag after removing.');
$plugin_bag->remove($random_name);
$this->assertFalse($plugin_bag->has($random_name), 'A random instance_id should not exist on the plugin bag after removing.');
$this->assertFalse($plugin_bag->has($random_name_2), 'A random instance_id should not exist on the plugin bag after removing.');
// Test that iterating over the plugins work.
$expected_instance_ids = array_keys($definitions);
......
......@@ -38,7 +38,7 @@ function testAccessRole() {
$view = views_get_view('test_access_role');
$view->setDisplay();
$view->displayHandlers['default']->options['access']['options']['role'] = array(
$view->displayHandlers->get('default')->options['access']['options']['role'] = array(
$this->normalRole => $this->normalRole,
);
......
......@@ -85,7 +85,7 @@ function testArgumentValidateUserEither() {
function view_argument_validate_user($argtype) {
$view = views_get_view('test_view_argument_validate_user');
$view->setDisplay();
$view->displayHandlers['default']->options['arguments']['null']['validate_options']['type'] = $argtype;
$view->displayHandlers->get('default')->options['arguments']['null']['validate_options']['type'] = $argtype;
$view->preExecute();
$view->initHandlers();
......
......@@ -69,7 +69,7 @@ function views_ajax() {
// Override the display's pager_element with the one actually used.
if (isset($pager_element)) {
$commands[] = views_ajax_command_scroll_top('.view-dom-id-' . $dom_id);
$view->displayHandlers[$display_id]->setOption('pager_element', $pager_element);
$view->displayHandlers->get($display_id)->setOption('pager_element', $pager_element);
}
// Reuse the same DOM id so it matches that in Drupal.settings.
$view->dom_id = $dom_id;
......
......@@ -324,7 +324,7 @@ public function newDisplay($plugin_id = 'page', $title = NULL, $id = NULL) {
$executable = $this->get('executable');
$executable->initDisplay();
$executable->displayHandlers->addInstanceID($id);
return $executable->displayHandlers[$id];
return $executable->displayHandlers->get($id);
}
return $id;
......
......@@ -195,7 +195,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$form['#title'] .= t('Attach to');
$displays = array();
foreach ($this->view->storage->get('display') as $display_id => $display) {
if (!empty($this->view->displayHandlers[$display_id]) && $this->view->displayHandlers[$display_id]->acceptAttachments()) {
if ($this->view->displayHandlers->has($display_id) && $this->view->displayHandlers->get($display_id)->acceptAttachments()) {
$displays[$display_id] = $display['display_title'];
}
}
......@@ -246,8 +246,8 @@ public function attachTo(ViewExecutable $view, $display_id) {
$view->setArguments($args);
$view->setDisplay($this->display['id']);
if ($this->getOption('inherit_pager')) {
$view->display_handler->usesPager = $this->view->displayHandlers[$display_id]->usesPager();
$view->display_handler->setOption('pager', $this->view->displayHandlers[$display_id]->getOption('pager'));
$view->display_handler->usesPager = $this->view->displayHandlers->get($display_id)->usesPager();
$view->display_handler->setOption('pager', $this->view->displayHandlers->get($display_id)->getOption('pager'));
}
$attachment = $view->executeDisplay($this->display['id'], $args);
......
......@@ -708,7 +708,7 @@ public function getAttachedDisplays() {
public function getLinkDisplay() {
$display_id = $this->getOption('link_display');
// If unknown, pick the first one.
if (empty($display_id) || empty($this->view->displayHandlers[$display_id])) {
if (empty($display_id) || !$this->view->displayHandlers->has($display_id)) {
foreach ($this->view->displayHandlers as $display_id => $display) {
if (!empty($display) && $display->hasPath()) {
return $display_id;
......@@ -733,8 +733,8 @@ public function getPath() {
}
$display_id = $this->getLinkDisplay();
if ($display_id && !empty($this->view->displayHandlers[$display_id]) && is_object($this->view->displayHandlers[$display_id])) {
return $this->view->displayHandlers[$display_id]->getPath();
if ($display_id && $this->view->displayHandlers->has($display_id) && is_object($this->view->displayHandlers->get($display_id))) {
return $this->view->displayHandlers->get($display_id)->getPath();
}
}
......@@ -1655,7 +1655,7 @@ public function buildOptionsForm(&$form, &$form_state) {
case 'link_display':
$form['#title'] .= t('Which display to use for path');
foreach ($this->view->storage->get('display') as $display_id => $display) {
if ($this->view->displayHandlers[$display_id]->hasPath()) {
if ($this->view->displayHandlers->get($display_id)->hasPath()) {
$options[$display_id] = $display['display_title'];
}
}
......
......@@ -213,7 +213,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$displays = array();
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()) {
if ($this->view->displayHandlers->has($display_id) && $this->view->displayHandlers->get($display_id)->acceptAttachments()) {
$displays[$display_id] = $display['display_title'];
}
}
......
......@@ -33,7 +33,7 @@ class Rss extends StylePluginBase {
protected $usesRowPlugin = TRUE;
function attach_to($display_id, $path, $title) {
$display = $this->view->displayHandlers[$display_id];
$display = $this->view->displayHandlers->get($display_id);
$url_options = array();
$input = $this->view->getExposedInput();
if ($input) {
......
......@@ -53,7 +53,7 @@ public function testSimpleFiltering() {
$view->setDisplay();
// Add a filter.
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'operator' => '<',
'value' => array(
......
......@@ -161,7 +161,7 @@ public function testTitleArea() {
$view->initDisplay('page_1');
// Add the title area handler to the empty area.
$view->displayHandlers['page_1']->overrideOption('empty', array(
$view->displayHandlers->get('page_1')->overrideOption('empty', array(
'title' => array(
'id' => 'title',
'table' => 'views',
......
......@@ -44,7 +44,7 @@ public function testAreaText() {
// add a text header
$string = $this->randomName();
$view->displayHandlers['default']->overrideOption('header', array(
$view->displayHandlers->get('default')->overrideOption('header', array(
'area' => array(
'id' => 'area',
'table' => 'views',
......
......@@ -43,7 +43,7 @@ public function testAreaText() {
// Add a null argument.
$string = $this->randomString();
$view->displayHandlers['default']->overrideOption('arguments', array(
$view->displayHandlers->get('default')->overrideOption('arguments', array(
'null' => array(
'id' => 'null',
'table' => 'views',
......@@ -69,7 +69,7 @@ public function testAreaText() {
// Add a argument, which has null as handler.
$string = $this->randomString();
$view->displayHandlers['default']->overrideOption('arguments', array(
$view->displayHandlers->get('default')->overrideOption('arguments', array(
'id' => array(
'id' => 'id',
'table' => 'views_test_data',
......
......@@ -47,7 +47,7 @@ public function testFieldBoolean() {
$view = views_get_view('test_view');
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'age' => array(
'id' => 'age',
'table' => 'views_test_data',
......
......@@ -38,7 +38,7 @@ protected function setUp() {
function testSimple() {
$view = views_get_view('test_view');
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'counter' => array(
'id' => 'counter',
'table' => 'views',
......@@ -64,7 +64,7 @@ function testSimple() {
$view->setDisplay();
$rand_start = rand(5, 10);
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'counter' => array(
'id' => 'counter',
'table' => 'views',
......
......@@ -41,7 +41,7 @@ public function testFieldCustom() {
// Alter the text of the field to a random string.
$random = $this->randomName();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'name' => array(
'id' => 'name',
'table' => 'views_test_data',
......
......@@ -39,7 +39,7 @@ public function testFieldDate() {
$view = views_get_view('test_view');
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'created' => array(
'id' => 'created',
'table' => 'views_test_data',
......
......@@ -52,7 +52,7 @@ public function testFieldFileSize() {
$view = views_get_view('test_view');
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'age' => array(
'id' => 'age',
'table' => 'views_test_data',
......
......@@ -44,7 +44,7 @@ public function testFieldUrl() {
$view = views_get_view('test_view');
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'name' => array(
'id' => 'name',
'table' => 'views_test_data',
......@@ -62,7 +62,7 @@ public function testFieldUrl() {
$view->destroy();
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'name' => array(
'id' => 'name',
'table' => 'views_test_data',
......
......@@ -53,7 +53,7 @@ public function testFieldXss() {
$view = views_get_view('test_view');
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('fields', array(
$view->displayHandlers->get('default')->overrideOption('fields', array(
'name' => array(
'id' => 'name',
'table' => 'views_test_data',
......
......@@ -38,8 +38,8 @@ public function testFilterCombineContains() {
$view = views_get_view('test_view');
$view->setDisplay();
$fields = $view->displayHandlers['default']->getOption('fields');
$view->displayHandlers['default']->overrideOption('fields', $fields + array(
$fields = $view->displayHandlers->get('default')->getOption('fields');
$view->displayHandlers->get('default')->overrideOption('fields', $fields + array(
'job' => array(
'id' => 'job',
'table' => 'views_test_data',
......@@ -49,7 +49,7 @@ public function testFilterCombineContains() {
));
// Change the filtering.
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'combine',
'table' => 'views',
......
......@@ -50,7 +50,7 @@ function testEqual() {
$view->setDisplay();
// Change the filtering
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'name' => array(
'id' => 'name',
'table' => 'views_test_data',
......@@ -78,7 +78,7 @@ public function testEqualGroupedExposed() {
// Filter: Name, Operator: =, Value: Ringo
$filters['name']['group_info']['default_group'] = 1;
$view->setDisplay('page_1');
$view->displayHandlers['page_1']->overrideOption('filters', $filters);
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$this->executeView($view);
$resultset = array(
......@@ -94,7 +94,7 @@ function testNotEqual() {
$view->setDisplay();
// Change the filtering
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'name' => array(
'id' => 'name',
'table' => 'views_test_data',
......@@ -131,7 +131,7 @@ public function testEqualGroupedNotExposed() {
// Filter: Name, Operator: !=, Value: Ringo
$filters['name']['group_info']['default_group'] = 2;
$view->setDisplay('page_1');
$view->displayHandlers['page_1']->overrideOption('filters', $filters);
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$this->executeView($view);
$resultset = array(
......
......@@ -51,7 +51,7 @@ public function testFilterInOperatorSimple() {
$view->setDisplay();
// Add a in_operator ordering.
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'age',
'field' => 'age',
......@@ -81,7 +81,7 @@ public function testFilterInOperatorSimple() {
$view->setDisplay();
// Add a in_operator ordering.
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'age',
'field' => 'age',
......@@ -119,7 +119,7 @@ public function testFilterInOperatorGroupedExposedSimple() {
// Filter: Age, Operator: in, Value: 26, 30
$filters['age']['group_info']['default_group'] = 1;
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('filters', $filters);
$view->displayHandlers->get('default')->overrideOption('filters', $filters);
$this->executeView($view);
......@@ -145,7 +145,7 @@ public function testFilterNotInOperatorGroupedExposedSimple() {
// Filter: Age, Operator: in, Value: 26, 30
$filters['age']['group_info']['default_group'] = 2;
$view->setDisplay();
$view->displayHandlers['default']->overrideOption('filters', $filters);
$view->displayHandlers->get('default')->overrideOption('filters', $filters);
$this->executeView($view);
......
......@@ -53,7 +53,7 @@ public function testFilterNumericSimple() {
$view->setDisplay();
// Change the filtering
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'age',
'table' => 'views_test_data',
......@@ -82,7 +82,7 @@ public function testFilterNumericExposedGroupedSimple() {
// Filter: Age, Operator: =, Value: 28
$filters['age']['group_info']['default_group'] = 1;
$view->setDisplay('page_1');
$view->displayHandlers['page_1']->overrideOption('filters', $filters);
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$this->executeView($view);
$resultset = array(
......@@ -99,7 +99,7 @@ public function testFilterNumericBetween() {
$view->setDisplay();
// Change the filtering
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'age',
'table' => 'views_test_data',
......@@ -135,7 +135,7 @@ public function testFilterNumericBetween() {
$view->setDisplay();
// Change the filtering
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'age',
'table' => 'views_test_data',
......@@ -175,7 +175,7 @@ public function testFilterNumericExposedGroupedBetween() {
// Filter: Age, Operator: between, Value: 26 and 29
$filters['age']['group_info']['default_group'] = 2;
$view->setDisplay('page_1');
$view->displayHandlers['page_1']->overrideOption('filters', $filters);
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$this->executeView($view);
$resultset = array(
......@@ -203,7 +203,7 @@ public function testFilterNumericExposedGroupedNotBetween() {
// Filter: Age, Operator: between, Value: 26 and 29
$filters['age']['group_info']['default_group'] = 3;
$view->setDisplay('page_1');
$view->displayHandlers['page_1']->overrideOption('filters', $filters);
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$this->executeView($view);
$resultset = array(
......@@ -228,7 +228,7 @@ public function testFilterNumericEmpty() {
$view->setDisplay();
// Change the filtering
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'age',
'table' => 'views_test_data',
......@@ -247,7 +247,7 @@ public function testFilterNumericEmpty() {
$view->setDisplay();
// Change the filtering
$view->displayHandlers['default']->overrideOption('filters', array(
$view->displayHandlers->get('default')->overrideOption('filters', array(
'age' => array(
'id' => 'age',
'table' => 'views_test_data',
......@@ -291,7 +291,7 @@ public function testFilterNumericExposedGroupedEmpty() {
// Filter: Age, Operator: empty, Value:
$filters['age']['group_info']['default_group'] = 4;
$view->setDisplay('page_1');
$view->displayHandlers['page_1']->overrideOption('filters', $filters);
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$this->executeView($view);
$resultset = array(
......@@ -307,7 +307,7 @@ public function testFilterNumericExposedGroupedNotEmpty() {
// Filter: Age, Operator: empty, Value:
$filters['age']['group_info']['default_group'] = 5;
$view->setDisplay('page_1');
$view->displayHandlers['page_1']->overrideOption('filters', $filters);
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
$this->executeView($view);
$resultset = array(
......@@ -339,7 +339,7 @@ public function testAllowEmpty() {
$view = views_get_view('test_view');
$view->setDisplay();