function ReservedWordTest::testSelectReservedWordTableAllFields

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php \Drupal\KernelTests\Core\Database\ReservedWordTest::testSelectReservedWordTableAllFields()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php \Drupal\KernelTests\Core\Database\ReservedWordTest::testSelectReservedWordTableAllFields()
  3. 10 core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php \Drupal\KernelTests\Core\Database\ReservedWordTest::testSelectReservedWordTableAllFields()

Tests SELECT query with all fields from a table with a reserved name.

File

core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php, line 38

Class

ReservedWordTest
Tests queries that include reserved words.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testSelectReservedWordTableAllFields() : void {
    $query = $this->connection
        ->select('virtual');
    $query->fields('virtual');
    $result = $query->execute()
        ->fetchObject();
    $this->assertSame('Function value 1', $result->function);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.