You are here

public function HandlerFieldFieldTest::_testSimpleFieldRender in Views (for Drupal 7) 8.3

1 call to HandlerFieldFieldTest::_testSimpleFieldRender()
HandlerFieldFieldTest::testFieldRender in lib/Drupal/views/Tests/Field/HandlerFieldFieldTest.php

File

lib/Drupal/views/Tests/Field/HandlerFieldFieldTest.php, line 83
Definition of Drupal\views\Test\Field\HandlerFieldFieldTest.

Class

HandlerFieldFieldTest
Tests the field_field handler. @TODO Check a entity-type with bundles Check a entity-type without bundles Check locale:disabled, locale:enabled and locale:enabled with another language Check revisions

Namespace

Drupal\views\Tests\Field

Code

public function _testSimpleFieldRender() {
  $view = $this
    ->getView();
  $this
    ->executeView($view);

  // Tests that the rendered fields match the actual value of the fields.
  for ($i = 0; $i < 3; $i++) {
    for ($key = 0; $key < 2; $key++) {
      $field = $this->fields[$key];
      $rendered_field = $view->style_plugin
        ->get_field($i, $field['field_name']);
      $expected_field = $this->nodes[$i]->{$field['field_name']}[LANGUAGE_NOT_SPECIFIED][0]['value'];
      $this
        ->assertEqual($rendered_field, $expected_field);
    }
  }
}