function ReservedWordTest::testSelectReservedWordAliasCount

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

Tests SELECT count query from a table with a reserved alias.

File

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

Class

ReservedWordTest
Tests queries that include reserved words.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testSelectReservedWordAliasCount() {
    $query = $this->connection
        ->select('test', 'character');
    $num_records = $query->countQuery()
        ->execute()
        ->fetchField();
    $this->assertSame('4', $num_records);
}

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