Definition of Drupal\views\Tests\Node\FieldTypeTest.
<?php
/**
* @file
* Definition of Drupal\views\Tests\Node\FieldTypeTest.
*/
namespace Drupal\views\Tests\Node;
/**
* Tests the Drupal\node\Plugin\views\field\Type handler.
*/
class FieldTypeTest extends NodeTestBase {
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = array(
'test_field_type',
);
public static function getInfo() {
return array(
'name' => 'Node: Node Type field',
'description' => 'Tests the Drupal\\node\\Plugin\\views\\field\\Type handler.',
'group' => 'Views Modules',
);
}
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 = views_get_view('test_field_type');
$this
->executeView($view);
$this
->assertIdenticalResultset($view, $expected_result, $column_map, 'The correct node type was displayed.');
}
}
Name | Description |
---|---|
FieldTypeTest | Tests the Drupal\node\Plugin\views\field\Type handler. |