You are here

public function DatabaseReservedKeywordTestCase::testSelectReservedWordAliasAllFields in Drupal 7

File

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

Class

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

Code

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