You are here

public function FieldTypeTest::testFieldType in Views (for Drupal 7) 8.3

File

lib/Drupal/views/Tests/Node/FieldTypeTest.php, line 23
Definition of Drupal\views\Tests\Node\FieldTypeTest.

Class

FieldTypeTest
Tests the Views\node\Plugin\views\field\Type handler.

Namespace

Drupal\views\Tests\Node

Code

public function testFieldType() {
  $node = $this
    ->drupalCreateNode();
  $expected_result[] = array(
    'nid' => $node
      ->id(),
    'node_type' => $node
      ->bundle(),
  );
  $column_map = array(
    'nid' => 'nid',
    'node_type' => 'node_type',
  );
  $view = $this
    ->getView();
  $view
    ->preview();
  $this
    ->executeView($view);
  $this
    ->assertIdenticalResultset($view, $expected_result, $column_map, 'The correct node type was displayed.');
}