public function FieldFieldTest::testRevisionExecute in Drupal 8
Same name and namespace in other branches
- 9 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 426
Class
- FieldFieldTest
- Provides some integration tests for the Field handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
public function testRevisionExecute() {
$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',
]);
}