Backup of db before drupal security update
[yaffs-website] / web / core / modules / block_content / src / Tests / Views / FieldTypeTest.php
1 <?php
2
3 namespace Drupal\block_content\Tests\Views;
4
5 use Drupal\views\Views;
6
7 /**
8  * Tests the Drupal\block_content\Plugin\views\field\Type handler.
9  *
10  * @group block_content
11  */
12 class FieldTypeTest extends BlockContentTestBase {
13
14   /**
15    * Views used by this test.
16    *
17    * @var array
18    */
19   public static $testViews = ['test_field_type'];
20
21   public function testFieldType() {
22     $block_content = $this->createBlockContent();
23     $expected_result[] = [
24       'id' => $block_content->id(),
25       'type' => $block_content->bundle(),
26     ];
27     $column_map = [
28       'id' => 'id',
29       'type:target_id' => 'type',
30     ];
31
32     $view = Views::getView('test_field_type');
33     $this->executeView($view);
34     $this->assertIdenticalResultset($view, $expected_result, $column_map, 'The correct block_content type was displayed.');
35   }
36
37 }