public function FieldFieldTest::testFieldAlias 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::testFieldAlias()
Tests the result of a view with complex field configuration.
A complex field configuration contains multiple times the same field, with different delta limit / offset.
File
- core/
modules/ views/ src/ Tests/ Handler/ FieldFieldTest.php, line 299 - Contains \Drupal\views\Tests\Handler\FieldFieldTest.
Class
- FieldFieldTest
- Provides some integration tests for the Field handler.
Namespace
Drupal\views\Tests\HandlerCode
public function testFieldAlias() {
$executable = Views::getView('test_field_alias_test');
$executable
->execute();
$this
->assertTrue($executable->field['id'] instanceof Field);
$this
->assertTrue($executable->field['name'] instanceof Field);
$this
->assertTrue($executable->field['name_alias'] instanceof Field);
$this
->assertIdenticalResultset($executable, [
[
'id' => 1,
'name' => 'test 0',
'name_alias' => 'test 0',
],
[
'id' => 2,
'name' => 'test 1',
'name_alias' => 'test 1',
],
[
'id' => 3,
'name' => 'test 2',
'name_alias' => 'test 2',
],
[
'id' => 4,
'name' => 'test 3',
'name_alias' => 'test 3',
],
[
'id' => 5,
'name' => 'test 4',
'name_alias' => 'test 4',
],
], [
'id' => 'id',
'name' => 'name',
'name_alias' => 'name_alias',
]);
}