FieldLanguageTest.php in Zircon Profile 8
File
core/modules/language/src/Tests/Views/FieldLanguageTest.php
View source
<?php
namespace Drupal\language\Tests\Views;
use Drupal\views\Views;
class FieldLanguageTest extends LanguageTestBase {
public static $testViews = array(
'test_view',
);
public function testField() {
$view = Views::getView('test_view');
$view
->setDisplay();
$view->displayHandlers
->get('default')
->overrideOption('fields', array(
'langcode' => array(
'id' => 'langcode',
'table' => 'views_test_data',
'field' => 'langcode',
),
));
$this
->executeView($view);
$this
->assertEqual($view->field['langcode']
->advancedRender($view->result[0]), 'English');
$this
->assertEqual($view->field['langcode']
->advancedRender($view->result[1]), 'Lolspeak');
}
}