public function SelectTest::testSelectDuplicateAlias in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Database/SelectTest.php \Drupal\KernelTests\Core\Database\SelectTest::testSelectDuplicateAlias()
- 9 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 546
Class
- SelectTest
- Tests the Select query builder.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testSelectDuplicateAlias() {
$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.');
}