public function FieldXssTest::testFieldXss

File

drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FieldXssTest.php, line 52
Definition of Drupal\views\Tests\Handler\FieldXssTest.

Class

FieldXssTest
Tests the core Drupal\views\Plugin\views\field\Xss handler.

Namespace

Drupal\views\Tests\Handler

Code

public function testFieldXss() {
  $view = views_get_view('test_view');
  $view
    ->setDisplay();
  $view->displayHandlers['default']
    ->overrideOption('fields', array(
    'name' => array(
      'id' => 'name',
      'table' => 'views_test_data',
      'field' => 'name',
    ),
  ));
  $this
    ->executeView($view);
  $counter = 0;
  foreach ($this
    ->dataHelper() as $input => $expected_result) {
    $view->result[$counter]->views_test_data_name = $input;
    $this
      ->assertEqual($view->field['name']
      ->advanced_render($view->result[$counter]), $expected_result);
    $counter++;
  }
}