function CurrencyAmountViewsHandlerFieldWebTestCase::viewsData in Currency 7.2
Overrides parent::viewsData();
Overrides ViewsSqlTest::viewsData
File
- currency/
tests/ CurrencyAmountViewsHandlerFieldWebTestCase.test, line 60 - Contains class CurrencyAmountViewsHandlerFieldWebTestCase.
Class
- CurrencyAmountViewsHandlerFieldWebTestCase
- Tests CurrencyAmountViewsHandlerField.
Code
function viewsData() {
// Declaration of the base table.
$data['views_test']['table'] = array(
'group' => t('Views test'),
'base' => array(
'field' => 'id',
'title' => t('Views test'),
),
);
// Declaration of fields.
$data['views_test']['currency_code'] = array(
'title' => t('Currency code'),
'help' => t('Currency code'),
'field' => array(
'handler' => 'views_handler_field',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['views_test']['amount_currency_code_definition'] = array(
'title' => t('Amount'),
'help' => t('Amount'),
'field' => array(
'handler' => 'CurrencyAmountViewsHandlerField',
'currency_code' => 'EUR',
),
);
$data['views_test']['amount_currency_code_field_definition'] = array(
'title' => t('Amount'),
'help' => t('Amount'),
'field' => array(
'handler' => 'CurrencyAmountViewsHandlerField',
'currency_code' => 'UAH',
'currency_code_field' => 'currency_code',
),
);
$data['views_test']['amount_currency_code_field_table_definition'] = array(
'title' => t('Amount'),
'help' => t('Amount'),
'field' => array(
'handler' => 'CurrencyAmountViewsHandlerField',
'currency_code' => 'UAH',
'currency_code_field' => 'currency_code',
'currency_code_table' => 'views_test',
),
);
$data['views_test']['amount_currency_undefined'] = array(
'title' => t('Amount'),
'help' => t('Amount'),
'field' => array(
'handler' => 'CurrencyAmountViewsHandlerField',
),
);
return $data;
}