public function FieldFieldTest::testRevisionRender in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php \Drupal\Tests\views\Kernel\Handler\FieldFieldTest::testRevisionRender()
Tests the output of a revision view with base and configurable fields.
File
- core/
modules/ views/ tests/ src/ Kernel/ Handler/ FieldFieldTest.php, line 447
Class
- FieldFieldTest
- Provides some integration tests for the Field handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
public function testRevisionRender() {
$executable = Views::getView('test_field_field_revision_test');
$executable
->execute();
$this
->assertEquals('1', $executable
->getStyle()
->getField(0, 'id'));
$this
->assertEquals('1', $executable
->getStyle()
->getField(0, 'revision_id'));
$this
->assertEquals('1', $executable
->getStyle()
->getField(0, 'field_test'));
$this
->assertEquals('base value', $executable
->getStyle()
->getField(0, 'name'));
$this
->assertEquals('1', $executable
->getStyle()
->getField(1, 'id'));
$this
->assertEquals('2', $executable
->getStyle()
->getField(1, 'revision_id'));
$this
->assertEquals('2', $executable
->getStyle()
->getField(1, 'field_test'));
$this
->assertEquals('revision value1', $executable
->getStyle()
->getField(1, 'name'));
$this
->assertEquals('1', $executable
->getStyle()
->getField(2, 'id'));
$this
->assertEquals('3', $executable
->getStyle()
->getField(2, 'revision_id'));
$this
->assertEquals('3', $executable
->getStyle()
->getField(2, 'field_test'));
$this
->assertEquals('revision value2', $executable
->getStyle()
->getField(2, 'name'));
$this
->assertEquals('2', $executable
->getStyle()
->getField(3, 'id'));
$this
->assertEquals('4', $executable
->getStyle()
->getField(3, 'revision_id'));
$this
->assertEquals('4', $executable
->getStyle()
->getField(3, 'field_test'));
$this
->assertEquals('next entity value', $executable
->getStyle()
->getField(3, 'name'));
}