function DatabaseSelectTestCase::testSelectDuplicateAlias

7.x database_test.test DatabaseSelectTestCase::testSelectDuplicateAlias()

Test that aliases are renamed when duplicates.

File

drupal/modules/simpletest/tests/database_test.test, line 1654

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