public function FieldFieldTest::testRevisionComplexExecute 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::testRevisionComplexExecute()
Tests the result set of a complex revision view.
File
- core/
modules/ views/ src/ Tests/ Handler/ FieldFieldTest.php, line 470 - Contains \Drupal\views\Tests\Handler\FieldFieldTest.
Class
- FieldFieldTest
- Provides some integration tests for the Field handler.
Namespace
Drupal\views\Tests\HandlerCode
public function testRevisionComplexExecute() {
$executable = Views::getView('test_field_field_revision_complex_test');
$executable
->execute();
$timezones = [];
foreach ($this->testUsers as $user) {
$timezones[] = $user
->getTimeZone();
}
$this
->assertTrue($executable->field['id'] instanceof Field);
$this
->assertTrue($executable->field['revision_id'] instanceof Field);
$this
->assertTrue($executable->field['timezone'] instanceof Field);
$this
->assertTrue($executable->field['field_test_multiple'] instanceof Field);
$this
->assertTrue($executable->field['field_test_multiple_1'] instanceof Field);
$this
->assertTrue($executable->field['field_test_multiple_2'] instanceof Field);
$this
->assertIdenticalResultset($executable, [
[
'id' => 1,
'field_test' => 1,
'revision_id' => 1,
'uid' => $this->testUsers[0]
->id(),
'timezone' => $timezones[0],
'field_test_multiple' => [
1,
3,
7,
],
'field_test_multiple_1' => [
1,
3,
7,
],
'field_test_multiple_2' => [
1,
3,
7,
],
],
[
'id' => 1,
'field_test' => 2,
'revision_id' => 2,
'uid' => $this->testUsers[1]
->id(),
'timezone' => $timezones[1],
'field_test_multiple' => [
0,
3,
5,
],
'field_test_multiple_1' => [
0,
3,
5,
],
'field_test_multiple_2' => [
0,
3,
5,
],
],
[
'id' => 1,
'field_test' => 3,
'revision_id' => 3,
'uid' => $this->testUsers[2]
->id(),
'timezone' => $timezones[2],
'field_test_multiple' => [
9,
9,
9,
],
'field_test_multiple_1' => [
9,
9,
9,
],
'field_test_multiple_2' => [
9,
9,
9,
],
],
[
'id' => 2,
'field_test' => 4,
'revision_id' => 4,
'uid' => $this->testUsers[3]
->id(),
'timezone' => $timezones[3],
'field_test_multiple' => [
2,
9,
9,
],
'field_test_multiple_1' => [
2,
9,
9,
],
'field_test_multiple_2' => [
2,
9,
9,
],
],
], [
'entity_test_rev_revision_id' => 'id',
'revision_id' => 'revision_id',
'users_field_data_entity_test_rev_revision_uid' => 'uid',
'timezone' => 'timezone',
'field_test_multiple' => 'field_test_multiple',
'field_test_multiple_1' => 'field_test_multiple_1',
'field_test_multiple_2' => 'field_test_multiple_2',
]);
}