aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/select_test.php
diff options
context:
space:
mode:
authorPatrick Webster <noxwizard@phpbb.com>2012-05-08 18:45:51 -0500
committerPatrick Webster <noxwizard@phpbb.com>2012-05-08 18:45:51 -0500
commitafbaa6979b62acb16fa09247ec4613d5d7d683fa (patch)
treeaba5ed9084f16c8e4ffed3309e3b9111b6602480 /tests/dbal/select_test.php
parente52d23848a1b116d32fbad9dd384e0755553b829 (diff)
downloadforums-afbaa6979b62acb16fa09247ec4613d5d7d683fa.tar
forums-afbaa6979b62acb16fa09247ec4613d5d7d683fa.tar.gz
forums-afbaa6979b62acb16fa09247ec4613d5d7d683fa.tar.bz2
forums-afbaa6979b62acb16fa09247ec4613d5d7d683fa.tar.xz
forums-afbaa6979b62acb16fa09247ec4613d5d7d683fa.zip
[ticket/10858] Tests for row seeking with fetchfield()
PHPBB3-10858
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(