You are here

function DatabaseSelectTestCase::testSelectDuplicateAlias in Drupal 7

Test that aliases are renamed when duplicates.

File

modules/simpletest/tests/database_test.test, line 1719

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