You are here

public function DatabaseReservedKeywordTestCase::testSelectReservedWordTableSpecificField in Drupal 7

File

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

Class

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

Code

public function testSelectReservedWordTableSpecificField() {
  $record = db_select('virtual')
    ->fields('virtual', array(
    'function',
  ))
    ->execute()
    ->fetchAssoc();
  $this
    ->assertEqual($record['function'], 'Function value 1', 'Successfully read a field from a table with a name and column which are reserved words.');
}