function TemporaryQueryTest::countTableRows

Returns the number of rows of a table.

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

File

drupal/core/modules/system/lib/Drupal/system/Tests/Database/TemporaryQueryTest.php, line 33
Definition of Drupal\system\Tests\Database\TemporaryQueryTest.

Class

TemporaryQueryTest
Tests temporary queries.

Namespace

Drupal\system\Tests\Database

Code

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