You are here

function TemporaryQueryTest::countTableRows in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Database/TemporaryQueryTest.php \Drupal\system\Tests\Database\TemporaryQueryTest::countTableRows()

Returns the number of rows of a table.

1 call to TemporaryQueryTest::countTableRows()
TemporaryQueryTest::testTemporaryQuery in core/modules/system/src/Tests/Database/TemporaryQueryTest.php
Confirms that temporary tables work and are limited to one request.

File

core/modules/system/src/Tests/Database/TemporaryQueryTest.php, line 27
Contains \Drupal\system\Tests\Database\TemporaryQueryTest.

Class

TemporaryQueryTest
Tests the temporary query functionality.

Namespace

Drupal\system\Tests\Database

Code

function countTableRows($table_name) {
  return db_select($table_name)
    ->countQuery()
    ->execute()
    ->fetchField();
}