function SelectTest::testSelectDuplicateAlias
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/SelectTest.php \Drupal\KernelTests\Core\Database\SelectTest::testSelectDuplicateAlias()
- 8.9.x core/tests/Drupal/KernelTests/Core/Database/SelectTest.php \Drupal\KernelTests\Core\Database\SelectTest::testSelectDuplicateAlias()
- 11.x core/tests/Drupal/KernelTests/Core/Database/SelectTest.php \Drupal\KernelTests\Core\Database\SelectTest::testSelectDuplicateAlias()
Tests that aliases are renamed when they are duplicates.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ SelectTest.php, line 548
Class
- SelectTest
- Tests the Select query builder.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testSelectDuplicateAlias() : void {
$query = $this->connection
->select('test', 't');
$alias1 = $query->addField('t', 'name', 'the_alias');
$alias2 = $query->addField('t', 'age', 'the_alias');
$this->assertNotSame($alias1, $alias2, 'Duplicate aliases are renamed.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.