mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10858] Tests for row seeking with fetchfield()
PHPBB3-10858
This commit is contained in:
parent
e52d23848a
commit
afbaa6979b
1 changed files with 26 additions and 0 deletions
|
@ -125,6 +125,32 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
|
||||||
$this->assertEquals($expected, $ary);
|
$this->assertEquals($expected, $ary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function fetchfield_seek_data()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array(1, 'foobar'),
|
||||||
|
array(0, 'barfoo'),
|
||||||
|
array(2, 'bertie'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider fetchfield_seek_data
|
||||||
|
*/
|
||||||
|
public function test_fetchfield_seek($rownum, $expected)
|
||||||
|
{
|
||||||
|
$db = $this->new_dbal();
|
||||||
|
|
||||||
|
$result = $db->sql_query('SELECT username_clean
|
||||||
|
FROM phpbb_users
|
||||||
|
ORDER BY user_id ASC');
|
||||||
|
|
||||||
|
$field = $db->sql_fetchfield('username_clean', $rownum, $result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $field);
|
||||||
|
}
|
||||||
|
|
||||||
public static function query_limit_data()
|
public static function query_limit_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
|
Loading…
Add table
Reference in a new issue