File: /home/iestorre/www2/modules/views/tests/handlers/views_handler_field_custom.test
<?php
module_load_include('test', 'views', 'tests/views_query');
class ViewsHandlerFieldCustomTest extends ViewsSqlTest {
public static function getInfo() {
return array(
'name' => 'Field: Custom',
'description' => 'Test the core views_handler_field_custom handler.',
'group' => 'Views Handlers',
);
}
function viewsData() {
$data = parent::viewsData();
$data['views_test']['name']['field']['handler'] = 'views_handler_field_custom';
return $data;
}
public function testFieldBoolean() {
$view = $this->getBasicView();
// Alter the text of the field to a random string.
$random = $this->randomName();
$view->display['default']->handler->override_option('fields', array(
'name' => array(
'id' => 'name',
'table' => 'views_test',
'field' => 'name',
'relationship' => 'none',
'alter' => array(
'text' => $random,
),
),
));
$this->executeView($view);
$this->assertEqual($random, $view->field['name']->advanced_render($view->result[0]));
}
}