protected function UcAddressesViewsTestCase::createAccessFiltersView in Ubercart Addresses 6.2
Same name and namespace in other branches
- 7 tests/uc_addresses.views.test \UcAddressesViewsTestCase::createAccessFiltersView()
Creates a View for access filters test.
Return value
object The created View.
1 call to UcAddressesViewsTestCase::createAccessFiltersView()
- UcAddressesViewsTestCase::testAccessFilters in tests/
uc_addresses.views.test - Tests if the address access filters work as expected.
File
- tests/
uc_addresses.views.test, line 551 - Test cases for Views integration.
Class
- UcAddressesViewsTestCase
- Test cases for Views integration.
Code
protected function createAccessFiltersView() {
views_include('view');
$view = new view();
$view->vid = 'new';
$view->name = 'uc_addresses_access_filters';
$view->description = 'Used to test if address access filters work as expected.';
$view->tag = 'default';
$view->base_table = 'uc_addresses';
$view->human_name = 'uc_addresses_access_filters';
$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['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';
// For Views 6.x-2.x to show all items.
$handler
->override_option('items_per_page', 0);
/* 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', 'page_1');
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter: Ubercart Addresses: Access */
$handler->display->display_options['filters']['access_view']['id'] = 'access_view';
$handler->display->display_options['filters']['access_view']['table'] = 'uc_addresses';
$handler->display->display_options['filters']['access_view']['field'] = 'access_view';
$handler->display->display_options['filters']['access_view']['value'] = '1';
$handler->display->display_options['path'] = 'uc_addresses/view';
/* Display: uc_addresses_edit_access */
$handler = $view
->new_display('page', 'uc_addresses_edit_access', 'page_2');
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter: Ubercart Addresses: Edit access */
$handler->display->display_options['filters']['access_edit']['id'] = 'access_edit';
$handler->display->display_options['filters']['access_edit']['table'] = 'uc_addresses';
$handler->display->display_options['filters']['access_edit']['field'] = 'access_edit';
$handler->display->display_options['filters']['access_edit']['value'] = '1';
$handler->display->display_options['path'] = 'uc_addresses/edit';
/* Display: uc_addresses_delete_access */
$handler = $view
->new_display('page', 'uc_addresses_delete_access', 'page_3');
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter: Ubercart Addresses: Delete access */
$handler->display->display_options['filters']['access_delete']['id'] = 'access_delete';
$handler->display->display_options['filters']['access_delete']['table'] = 'uc_addresses';
$handler->display->display_options['filters']['access_delete']['field'] = 'access_delete';
$handler->display->display_options['filters']['access_delete']['value'] = '1';
$handler->display->display_options['path'] = 'uc_addresses/delete';
// Save View.
$this
->UcAddressesSaveView($view);
return $view;
}