You are here

public function ViewsHandlerTestXss::testFieldXss in Views (for Drupal 7) 7.3

File

tests/handlers/views_handler_field_xss.test, line 39
Definition of ViewsHandlerTestXss.

Class

ViewsHandlerTestXss
Tests the core views_handler_field_css handler.

Code

public function testFieldXss() {
  $view = $this
    ->getBasicView();
  $view->display['default']->handler
    ->override_option('fields', array(
    'name' => array(
      'id' => 'name',
      'table' => 'views_test',
      'field' => 'name',
    ),
  ));
  $this
    ->executeView($view);
  $counter = 0;
  foreach ($this
    ->dataHelper() as $input => $expected_result) {
    $view->result[$counter]->views_test_name = $input;
    $this
      ->assertEqual($view->field['name']
      ->advanced_render($view->result[$counter]), $expected_result);
    $counter++;
  }
}