You are here

public function QueryTest::testQuotingIdentifiers in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Database/QueryTest.php \Drupal\KernelTests\Core\Database\QueryTest::testQuotingIdentifiers()

Tests quoting identifiers in queries.

File

core/tests/Drupal/KernelTests/Core/Database/QueryTest.php, line 160

Class

QueryTest
Tests Drupal's extended prepared statement syntax..

Namespace

Drupal\KernelTests\Core\Database

Code

public function testQuotingIdentifiers() {

  // Use the table named an ANSI SQL reserved word with a column that is as
  // well.
  $result = $this->connection
    ->query('SELECT [update] FROM {select}')
    ->fetchObject();
  $this
    ->assertEquals('Update value 1', $result->update);
}