You are here

protected function UcAddressesViewsTestCase::createArgumentValidatorView3 in Ubercart Addresses 6.2

Creates a View for Argument validator test for Views 3.

Return value

object The created View.

1 call to UcAddressesViewsTestCase::createArgumentValidatorView3()
UcAddressesViewsTestCase::testArgumentValidatorPlugins in tests/uc_addresses.views.test
Tests if the argument validator plugins work as expected.

File

tests/uc_addresses.views.test, line 982
Test cases for Views integration.

Class

UcAddressesViewsTestCase
Test cases for Views integration.

Code

protected function createArgumentValidatorView3() {
  views_include('view');
  $view = new view();
  $view->vid = 'new';
  $view->name = 'uc_addresses_argument_validator';
  $view->description = 'Used to test if display access restrictions work as expected.';
  $view->tag = 'default';
  $view->base_table = 'uc_addresses';
  $view->human_name = 'uc_addresses_argument_validator';
  $view->core = 6;
  $view->api_version = '3.0';
  $view->disabled = FALSE;

  /* Edit this to true to make a default view disabled initially */

  /* Display: Master */
  $handler = $view
    ->new_display('default', 'Master', 'default');
  $handler->display->display_options['items_per_page'] = 0;
  $handler->display->display_options['access']['type'] = 'none';
  $handler->display->display_options['cache']['type'] = 'none';
  $handler->display->display_options['query']['type'] = 'views_query';
  $handler->display->display_options['exposed_form']['type'] = 'basic';
  $handler->display->display_options['pager']['type'] = 'none';
  $handler->display->display_options['style_plugin'] = 'default';
  $handler->display->display_options['row_plugin'] = 'fields';

  /* Field: Ubercart Addresses: Address ID */
  $handler->display->display_options['fields']['aid']['id'] = 'aid';
  $handler->display->display_options['fields']['aid']['table'] = 'uc_addresses';
  $handler->display->display_options['fields']['aid']['field'] = 'aid';

  /* Field: Ubercart Addresses: Address name */
  $handler->display->display_options['fields']['address_name']['id'] = 'address_name';
  $handler->display->display_options['fields']['address_name']['table'] = 'uc_addresses';
  $handler->display->display_options['fields']['address_name']['field'] = 'address_name';

  /* Display: uc_addresses_view_access */
  $handler = $view
    ->new_display('page', 'uc_addresses_view_access', 'uc_addresses_view_access');
  $handler->display->display_options['defaults']['arguments'] = FALSE;

  /* Argument: Ubercart Addresses: User ID */
  $handler->display->display_options['arguments']['uid']['id'] = 'uid';
  $handler->display->display_options['arguments']['uid']['table'] = 'uc_addresses';
  $handler->display->display_options['arguments']['uid']['field'] = 'uid';
  $handler->display->display_options['arguments']['uid']['default_action'] = 'not found';
  $handler->display->display_options['arguments']['uid']['style_plugin'] = 'default_summary';
  $handler->display->display_options['arguments']['uid']['default_argument_type'] = 'fixed';
  $handler->display->display_options['arguments']['uid']['default_argument_skip_url'] = 0;
  $handler->display->display_options['arguments']['uid']['validate_type'] = 'uc_addresses_user_address_access';
  $handler->display->display_options['arguments']['uid']['validate_options']['access_type'] = 'view';
  $handler->display->display_options['arguments']['uid']['break_phrase'] = 0;
  $handler->display->display_options['arguments']['uid']['not'] = 0;

  /* Argument: Ubercart Addresses: Address ID */
  $handler->display->display_options['arguments']['aid']['id'] = 'aid';
  $handler->display->display_options['arguments']['aid']['table'] = 'uc_addresses';
  $handler->display->display_options['arguments']['aid']['field'] = 'aid';
  $handler->display->display_options['arguments']['aid']['style_plugin'] = 'default_summary';
  $handler->display->display_options['arguments']['aid']['default_argument_type'] = 'fixed';
  $handler->display->display_options['arguments']['aid']['default_argument_skip_url'] = 0;
  $handler->display->display_options['arguments']['aid']['validate_type'] = 'uc_addresses_address_access';
  $handler->display->display_options['arguments']['aid']['validate_options']['access_type'] = 'view';
  $handler->display->display_options['arguments']['aid']['break_phrase'] = 0;
  $handler->display->display_options['arguments']['aid']['not'] = 0;
  $handler->display->display_options['path'] = 'user/%/uc_addresses_argument_validator_view';
  $handler->display->display_options['menu']['type'] = 'tab';
  $handler->display->display_options['menu']['title'] = 'AddressBookView';
  $handler->display->display_options['menu']['weight'] = '0';

  /* Display: uc_addresses_edit_access */
  $handler = $view
    ->new_display('page', 'uc_addresses_edit_access', 'uc_addresses_edit_access');
  $handler->display->display_options['defaults']['arguments'] = FALSE;

  /* Argument: Ubercart Addresses: User ID */
  $handler->display->display_options['arguments']['uid']['id'] = 'uid';
  $handler->display->display_options['arguments']['uid']['table'] = 'uc_addresses';
  $handler->display->display_options['arguments']['uid']['field'] = 'uid';
  $handler->display->display_options['arguments']['uid']['default_action'] = 'not found';
  $handler->display->display_options['arguments']['uid']['style_plugin'] = 'default_summary';
  $handler->display->display_options['arguments']['uid']['default_argument_type'] = 'fixed';
  $handler->display->display_options['arguments']['uid']['default_argument_skip_url'] = 0;
  $handler->display->display_options['arguments']['uid']['validate_type'] = 'uc_addresses_user_address_access';
  $handler->display->display_options['arguments']['uid']['validate_options']['access_type'] = 'edit';
  $handler->display->display_options['arguments']['uid']['break_phrase'] = 0;
  $handler->display->display_options['arguments']['uid']['not'] = 0;

  /* Argument: Ubercart Addresses: Address ID */
  $handler->display->display_options['arguments']['aid']['id'] = 'aid';
  $handler->display->display_options['arguments']['aid']['table'] = 'uc_addresses';
  $handler->display->display_options['arguments']['aid']['field'] = 'aid';
  $handler->display->display_options['arguments']['aid']['style_plugin'] = 'default_summary';
  $handler->display->display_options['arguments']['aid']['default_argument_type'] = 'fixed';
  $handler->display->display_options['arguments']['aid']['default_argument_skip_url'] = 0;
  $handler->display->display_options['arguments']['aid']['validate_type'] = 'uc_addresses_address_access';
  $handler->display->display_options['arguments']['aid']['validate_options']['access_type'] = 'edit';
  $handler->display->display_options['arguments']['aid']['break_phrase'] = 0;
  $handler->display->display_options['arguments']['aid']['not'] = 0;
  $handler->display->display_options['path'] = 'user/%/uc_addresses_argument_validator_edit';
  $handler->display->display_options['menu']['type'] = 'tab';
  $handler->display->display_options['menu']['title'] = 'AddressBookEdit';
  $handler->display->display_options['menu']['weight'] = '0';

  /* Display: uc_addresses_delete_access */
  $handler = $view
    ->new_display('page', 'uc_addresses_delete_access', 'uc_addresses_delete_access');
  $handler->display->display_options['defaults']['arguments'] = FALSE;

  /* Argument: Ubercart Addresses: User ID */
  $handler->display->display_options['arguments']['uid']['id'] = 'uid';
  $handler->display->display_options['arguments']['uid']['table'] = 'uc_addresses';
  $handler->display->display_options['arguments']['uid']['field'] = 'uid';
  $handler->display->display_options['arguments']['uid']['default_action'] = 'not found';
  $handler->display->display_options['arguments']['uid']['style_plugin'] = 'default_summary';
  $handler->display->display_options['arguments']['uid']['default_argument_type'] = 'fixed';
  $handler->display->display_options['arguments']['uid']['default_argument_skip_url'] = 0;
  $handler->display->display_options['arguments']['uid']['validate_type'] = 'uc_addresses_user_address_access';
  $handler->display->display_options['arguments']['uid']['validate_options']['access_type'] = 'delete';
  $handler->display->display_options['arguments']['uid']['break_phrase'] = 0;
  $handler->display->display_options['arguments']['uid']['not'] = 0;

  /* Argument: Ubercart Addresses: Address ID */
  $handler->display->display_options['arguments']['aid']['id'] = 'aid';
  $handler->display->display_options['arguments']['aid']['table'] = 'uc_addresses';
  $handler->display->display_options['arguments']['aid']['field'] = 'aid';
  $handler->display->display_options['arguments']['aid']['style_plugin'] = 'default_summary';
  $handler->display->display_options['arguments']['aid']['default_argument_type'] = 'fixed';
  $handler->display->display_options['arguments']['aid']['default_argument_skip_url'] = 0;
  $handler->display->display_options['arguments']['aid']['validate_type'] = 'uc_addresses_address_access';
  $handler->display->display_options['arguments']['aid']['validate_options']['access_type'] = 'delete';
  $handler->display->display_options['arguments']['aid']['break_phrase'] = 0;
  $handler->display->display_options['arguments']['aid']['not'] = 0;
  $handler->display->display_options['path'] = 'user/%/uc_addresses_argument_validator_delete';
  $handler->display->display_options['menu']['type'] = 'tab';
  $handler->display->display_options['menu']['title'] = 'AddressBookDelete';
  $handler->display->display_options['menu']['weight'] = '0';

  // Save View.
  $this
    ->UcAddressesSaveView($view);
  return $view;
}