You are here

public function DatabaseReservedKeywordTestCase::testSelectReservedWordAliasSpecificFields in Drupal 7

File

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

Class

DatabaseReservedKeywordTestCase
Test reserved keyword handling (introduced for MySQL 8+)

Code

public function testSelectReservedWordAliasSpecificFields() {
  $record = db_select('test', 'high_priority')
    ->fields('high_priority', array(
    'name',
  ))
    ->condition('age', 27)
    ->execute()
    ->fetchAssoc();
  $this
    ->assertEqual($record['name'], 'George', 'Successful query using an alias which is a reserved word.');
}