aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/select_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dbal/select_test.php')
-rw-r--r--tests/dbal/select_test.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index 05b0e68e29..9d46b47b17 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -357,4 +357,29 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertSame(false, $row);
}
+
+ public function test_get_row_count()
+ {
+ $this->assertSame(
+ 3,
+ (int) $this->new_dbal()->get_row_count('phpbb_users'),
+ "Failed asserting that user table has exactly 3 rows."
+ );
+ }
+
+ public function test_get_estimated_row_count()
+ {
+ $actual = $this->new_dbal()->get_estimated_row_count('phpbb_users');
+
+ if (is_string($actual) && isset($actual[0]) && $actual[0] === '~')
+ {
+ $actual = substr($actual, -1);
+ }
+
+ $this->assertGreaterThan(
+ 1,
+ $actual,
+ "Failed asserting that estimated row count of user table is greater than 1."
+ );
+ }
}