mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10653] Unit tests for get_row_count() and get_estimated_row_count().
PHPBB3-10653
This commit is contained in:
parent
f9953fc339
commit
6df721b215
1 changed files with 25 additions and 0 deletions
|
@ -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."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue