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.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index 21b12777dc..1b04450fcd 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -125,6 +125,32 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$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()
{
return array(