1 database_test.test DatabaseSelectTestCase::testSelectDuplicateAlias()

Test that aliases are renamed when duplicates.

File

core/modules/simpletest/tests/database_test.test, line 1667
Database tests.

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.');
}