public function FieldFieldTest::testRevisionComplexRender in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Tests/Handler/FieldFieldTest.php \Drupal\views\Tests\Handler\FieldFieldTest::testRevisionComplexRender()
Tests the output of a revision view with base fields and configurable fields.
File
- core/
modules/ views/ src/ Tests/ Handler/ FieldFieldTest.php, line 500 - Contains \Drupal\views\Tests\Handler\FieldFieldTest.
Class
- FieldFieldTest
- Provides some integration tests for the Field handler.
Namespace
Drupal\views\Tests\HandlerCode
public function testRevisionComplexRender() {
$executable = Views::getView('test_field_field_revision_complex_test');
$executable
->execute();
$this
->assertEqual('1', $executable
->getStyle()
->getField(0, 'id'));
$this
->assertEqual('1', $executable
->getStyle()
->getField(0, 'revision_id'));
$this
->assertEqual($this->testUsers[0]
->getTimeZone(), $executable
->getStyle()
->getField(0, 'timezone'));
$this
->assertEqual('1, 3, 7', $executable
->getStyle()
->getField(0, 'field_test_multiple'));
$this
->assertEqual('1', $executable
->getStyle()
->getField(0, 'field_test_multiple_1'));
$this
->assertEqual('3, 7', $executable
->getStyle()
->getField(0, 'field_test_multiple_2'));
$this
->assertEqual('1', $executable
->getStyle()
->getField(1, 'id'));
$this
->assertEqual('2', $executable
->getStyle()
->getField(1, 'revision_id'));
$this
->assertEqual($this->testUsers[1]
->getTimeZone(), $executable
->getStyle()
->getField(1, 'timezone'));
$this
->assertEqual('0, 3, 5', $executable
->getStyle()
->getField(1, 'field_test_multiple'));
$this
->assertEqual('0', $executable
->getStyle()
->getField(1, 'field_test_multiple_1'));
$this
->assertEqual('3, 5', $executable
->getStyle()
->getField(1, 'field_test_multiple_2'));
$this
->assertEqual('1', $executable
->getStyle()
->getField(2, 'id'));
$this
->assertEqual('3', $executable
->getStyle()
->getField(2, 'revision_id'));
$this
->assertEqual($this->testUsers[2]
->getTimeZone(), $executable
->getStyle()
->getField(2, 'timezone'));
$this
->assertEqual('9, 9, 9', $executable
->getStyle()
->getField(2, 'field_test_multiple'));
$this
->assertEqual('9', $executable
->getStyle()
->getField(2, 'field_test_multiple_1'));
$this
->assertEqual('9, 9', $executable
->getStyle()
->getField(2, 'field_test_multiple_2'));
$this
->assertEqual('2', $executable
->getStyle()
->getField(3, 'id'));
$this
->assertEqual('4', $executable
->getStyle()
->getField(3, 'revision_id'));
$this
->assertEqual($this->testUsers[3]
->getTimeZone(), $executable
->getStyle()
->getField(3, 'timezone'));
$this
->assertEqual('2, 9, 9', $executable
->getStyle()
->getField(3, 'field_test_multiple'));
$this
->assertEqual('2', $executable
->getStyle()
->getField(3, 'field_test_multiple_1'));
$this
->assertEqual('9, 9', $executable
->getStyle()
->getField(3, 'field_test_multiple_2'));
}