aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/select_test.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-05-09 12:55:58 +0200
committerAndreas Fischer <bantu@phpbb.com>2012-05-09 12:55:58 +0200
commit1a9b30b87118333f0d58eaec3762fc1a579d7b8a (patch)
tree58ec13e0f9bdf0acdbf0a82220b4e6257506a0b2 /tests/dbal/select_test.php
parent30579ecb09e2160c450e5d740c36ab052d2ec93d (diff)
parent12dbcc7f1e13f71b96a5aa31ece4632fb1eb4139 (diff)
downloadforums-1a9b30b87118333f0d58eaec3762fc1a579d7b8a.tar
forums-1a9b30b87118333f0d58eaec3762fc1a579d7b8a.tar.gz
forums-1a9b30b87118333f0d58eaec3762fc1a579d7b8a.tar.bz2
forums-1a9b30b87118333f0d58eaec3762fc1a579d7b8a.tar.xz
forums-1a9b30b87118333f0d58eaec3762fc1a579d7b8a.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/10858] Move generic row seeking to DBAL [ticket/10858] Tests for row seeking with fetchfield() [ticket/10858] Fix MSSQL Native's row seeking behavior Conflicts: tests/dbal/select_test.php
Diffstat (limited to 'tests/dbal/select_test.php')
-rw-r--r--tests/dbal/select_test.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index cc213f09bc..df888d9824 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -125,7 +125,33 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary);
}
- public function query_limit_data()
+ 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(
array(0, 0, array(array('username_clean' => 'barfoo'),