1.20.x database_test.test | public DatabaseReservedKeywordTestCase::testSelectReservedWordTableSpecificField() |
File
- modules/
simpletest/ tests/ database_test.test, line 4160 - Database tests.
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.');
}