You are here

public function ReservedWordTest::testSelectReservedWordTableCount in Drupal 8

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

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

File

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

Class

ReservedWordTest
Tests queries that include reserved words.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testSelectReservedWordTableCount() {
  $query = $this->connection
    ->select('virtual');
  $num_records = $query
    ->countQuery()
    ->execute()
    ->fetchField();
  $this
    ->assertSame('1', $num_records);
}