function DatabaseSelectTestCase::testSelectDuplicateAlias
Test that aliases are renamed when duplicates.
File
-
modules/
simpletest/ tests/ database_test.test, line 1844
Class
- DatabaseSelectTestCase
- Test the SELECT builder.
Code
function testSelectDuplicateAlias() {
$query = db_select('test', 't');
$alias1 = $query->addField('t', 'name', 'the_alias');
$alias2 = $query->addField('t', 'age', 'the_alias');
$this->assertNotIdentical($alias1, $alias2, 'Duplicate aliases are renamed.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.