public function ReservedWordTest::testSelectReservedWordTableSpecificField in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php \Drupal\KernelTests\Core\Database\ReservedWordTest::testSelectReservedWordTableSpecificField()
Tests SELECT query with a specific field from a table with a reserved name.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ ReservedWordTest.php, line 25
Class
- ReservedWordTest
- Tests queries that include reserved words.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testSelectReservedWordTableSpecificField() {
$query = $this->connection
->select('virtual');
$query
->addField('virtual', 'function');
$rows = $query
->execute()
->fetchCol();
$this
->assertSame('Function value 1', $rows[0]);
}