function FieldFieldTest::testRevisionExecute

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php \Drupal\Tests\views\Kernel\Handler\FieldFieldTest::testRevisionExecute()
  2. 8.9.x core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php \Drupal\Tests\views\Kernel\Handler\FieldFieldTest::testRevisionExecute()
  3. 10 core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php \Drupal\Tests\views\Kernel\Handler\FieldFieldTest::testRevisionExecute()

Tests the revision result.

File

core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php, line 452

Class

FieldFieldTest
Provides some integration tests for the Field handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testRevisionExecute() : void {
    $executable = Views::getView('test_field_field_revision_test');
    $executable->execute();
    $this->assertInstanceOf(EntityField::class, $executable->field['name']);
    $this->assertInstanceOf(EntityField::class, $executable->field['field_test']);
    $this->assertIdenticalResultset($executable, [
        [
            'id' => 1,
            'field_test' => 1,
            'revision_id' => 1,
            'name' => 'base value',
        ],
        [
            'id' => 1,
            'field_test' => 2,
            'revision_id' => 2,
            'name' => 'revision value1',
        ],
        [
            'id' => 1,
            'field_test' => 3,
            'revision_id' => 3,
            'name' => 'revision value2',
        ],
        [
            'id' => 2,
            'field_test' => 4,
            'revision_id' => 4,
            'name' => 'next entity value',
        ],
    ], [
        'entity_test_rev_revision_id' => 'id',
        'revision_id' => 'revision_id',
        'name' => 'name',
        'field_test' => 'field_test',
    ]);
}

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