protected function UcAddressesViewsTestCase::createActionLinksView in Ubercart Addresses 6.2
Same name and namespace in other branches
- 7 tests/uc_addresses.views.test \UcAddressesViewsTestCase::createActionLinksView()
Creates a View for Action links test.
Return value
object The created View.
1 call to UcAddressesViewsTestCase::createActionLinksView()
- UcAddressesViewsTestCase::testActionLinks in tests/
uc_addresses.views.test - Tests if the view, edit and delete links are only displayed for users that are allowed to perform these tasks.
File
- tests/
uc_addresses.views.test, line 627 - Test cases for Views integration.
Class
- UcAddressesViewsTestCase
- Test cases for Views integration.
Code
protected function createActionLinksView() {
views_include('view');
$view = new view();
$view->vid = 'new';
$view->name = 'uc_addresses_action_links';
$view->description = 'Used to test if address action links work as expected.';
$view->tag = 'default';
$view->base_table = 'uc_addresses';
$view->human_name = 'uc_addresses_action_links';
$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';
/* Field: Ubercart Addresses: Link */
$handler->display->display_options['fields']['view']['id'] = 'view';
$handler->display->display_options['fields']['view']['table'] = 'uc_addresses';
$handler->display->display_options['fields']['view']['field'] = 'view';
/* Field: Ubercart Addresses: Edit link */
$handler->display->display_options['fields']['edit']['id'] = 'edit';
$handler->display->display_options['fields']['edit']['table'] = 'uc_addresses';
$handler->display->display_options['fields']['edit']['field'] = 'edit';
/* Field: Ubercart Addresses: Delete link */
$handler->display->display_options['fields']['delete']['id'] = 'delete';
$handler->display->display_options['fields']['delete']['table'] = 'uc_addresses';
$handler->display->display_options['fields']['delete']['field'] = 'delete';
/* Display: Page */
$handler = $view
->new_display('page', 'Page', 'page_1');
$handler->display->display_options['path'] = 'uc_addresses/action-links';
// Save View.
$this
->UcAddressesSaveView($view);
return $view;
}