You are here

public function FieldLanguage::testField in Views (for Drupal 7) 8.3

File

lib/Drupal/views/Tests/Language/FieldLanguage.php, line 27
Definition of Drupal\views\Tests\Language\FieldLanguage.

Class

FieldLanguage
Tests the field language handler.

Namespace

Drupal\views\Tests\Language

Code

public function testField() {
  $view = $this
    ->getView();
  $view->displayHandlers['default']
    ->overrideOption('fields', array(
    'langcode' => array(
      'id' => 'langcode',
      'table' => 'views_test_data',
      'field' => 'langcode',
    ),
  ));
  $this
    ->executeView($view);
  $this
    ->assertEqual($view->field['langcode']
    ->advanced_render($view->result[0]), 'English');
  $this
    ->assertEqual($view->field['langcode']
    ->advanced_render($view->result[1]), 'Lolspeak');
}