function FieldTypeTest::testFieldType

Same name and namespace in other branches
  1. 8.9.x core/modules/block_content/tests/src/Functional/Views/FieldTypeTest.php \Drupal\Tests\block_content\Functional\Views\FieldTypeTest::testFieldType()
  2. 10 core/modules/block_content/tests/src/Kernel/Views/FieldTypeTest.php \Drupal\Tests\block_content\Kernel\Views\FieldTypeTest::testFieldType()
  3. 11.x core/modules/block_content/tests/src/Kernel/Views/FieldTypeTest.php \Drupal\Tests\block_content\Kernel\Views\FieldTypeTest::testFieldType()

File

core/modules/block_content/tests/src/Functional/Views/FieldTypeTest.php, line 26

Class

FieldTypeTest
Tests the Drupal\block_content\Plugin\views\field\Type handler.

Namespace

Drupal\Tests\block_content\Functional\Views

Code

public function testFieldType() {
    $block_content = $this->createBlockContent();
    $expected_result[] = [
        'id' => $block_content->id(),
        'type' => $block_content->bundle(),
    ];
    $column_map = [
        'id' => 'id',
        'type:target_id' => 'type',
    ];
    $view = Views::getView('test_field_type');
    $this->executeView($view);
    $this->assertIdenticalResultset($view, $expected_result, $column_map, 'The correct block_content type was displayed.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.