123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- * @file
- * Definition of ViewsHandlerFieldUrlTest.
- */
- /**
- * Tests the core views_handler_field_url handler.
- */
- class ViewsHandlerFieldUrlTest extends ViewsSqlTest {
- public static function getInfo() {
- return array(
- 'name' => 'Field: Url',
- 'description' => 'Test the core views_handler_field_url handler.',
- 'group' => 'Views Handlers',
- );
- }
- function viewsData() {
- $data = parent::viewsData();
- $data['views_test']['name']['field']['handler'] = 'views_handler_field_url';
- return $data;
- }
- public function testFieldUrl() {
- $view = $this->getBasicView();
- $view->display['default']->handler->override_option('fields', array(
- 'name' => array(
- 'id' => 'name',
- 'table' => 'views_test',
- 'field' => 'name',
- 'relationship' => 'none',
- 'display_as_link' => FALSE,
- ),
- ));
- $this->executeView($view);
- $this->assertEqual('John', $view->field['name']->advanced_render($view->result[0]));
- // Make the url a link.
- $view->delete();
- $view = $this->getBasicView();
- $view->display['default']->handler->override_option('fields', array(
- 'name' => array(
- 'id' => 'name',
- 'table' => 'views_test',
- 'field' => 'name',
- 'relationship' => 'none',
- ),
- ));
- $this->executeView($view);
- $this->assertEqual(l('John', 'John'), $view->field['name']->advanced_render($view->result[0]));
- }
- }
|